Bug 7009

Error importing Plain JSON string generated from ExportRowasJSON method 09 December, 2021

Matt Balent
26 July, 2021
Product: PowerBuilder Category: DataWindow
Version: 2019 R3 Build: 2703
Classification: Issue Publishing: Public
Priority: P3
Status: Verifying Reason:
Communication Status: Waiting for Customer
Mark Lee @Appeon 09 December, 2021
Hi Matt,

We have been trying to keep in touch with you to find out about the resolution of this issue, we would like to continue with our support but without more information, we are in the need to close it in the next 3 working days, according to our internal help support policy but please remember you can always open a new ticket.  

Mark Lee
Mark Lee @Appeon 21 November, 2021
Hi Matt,

I'm just touching base with you about this ticket.  
Did we provide you with enough information to resolve this issue?. 

Please let us know if there is something else to support you with.  
Remember that you can always open a new ticket if need it. 

Mark Lee
Mark Lee @Appeon 04 November, 2021
Hi Matt,

I would like to check with you if the response provided has been helpful enough to resolve your case. If so, can we proceed to close the ticket?. Otherwise, please let us know if we can provide you with any further assistance, remember that you can always open another ticket any time you need it. 

Mark Lee
Mark Lee @Appeon 11 October, 2021
Hi Matt,

Just to let you know, this issue is not a bug, but a usage issue.
You need to modify your importjson code referring to the below so that it properly imports data into dataWindow
Comment your original code:
//li = dw_2.importjson(is_json)
Add new code:
li = dw_2.ImportRowFromJson(is_json, 1) 
If you want to import data to datawindow by using the importjson function, the JSON string must be in the format described in the section called “Supported JSON formats” in Application Techniques.:
The structure of DataWindow JSON is as follows:
"identity": "70c86603-983b-4bd9-adbc-259436e43cbd",
"mapping-method": 0,
    "meta-columns": [COLUMN-META1, COLUMN-META2…],
    "primary-rows": [DW-STANDARD-ROW1, DW-STANDARD-ROW2…],
    "filter-rows": [DW-STANDARD-ROW1, DW-STANDARD-ROW2…],
    "delete-rows": [DW-STANDARD-ROW1, DW-STANDARD-ROW2…],
    "dwchilds":{"department_id": [SIMPLE-ROW1,SIMPLE-ROW2…],
                "category_id": [SIMPLE-ROW1,SIMPLE-ROW2…]
You can refer to the following links for more details:

Mark Lee
Mark Lee @Appeon 27 July, 2021
Hi Matt,

Thanks for reporting this problem! 
We reproduced it on our end and will do further research to figure it out. 
We will keep you updated!

Mark Lee
Thanks for providing a sample Test Case, Matt!

I will now transfer this to our main Support/Engineering team for their review and feedback.

Matt Balent 26 July, 2021
w_dwjsonimport.zip (4KB)

run window, click Export button.  Note JSON in the MLE control, Click Import button.  Note error returned.
Hi Matt,

Thanks for reporting this issue! Could you submit a test case that manifests this issue?

Matt Balent 26 July, 2021
*Phenomenon; Have an external datawindow with ten columns, most of which are dddws themselves.  Insert a blank row and then perform a ExportRowasJSON to get a 'base' JSON string for this datawindow (all JSON values are NULL).  When I attempt to import this JSON back into the datawindow using the Datawindow importjson method I receive a -5 ' (JSON format error per the help)

*Reproduce Steps:

The generated JSON string is valid if I use the json parser object 'LoadString' method

The importjson on the ribbonbar doesn't accept null data per the help file but this is on a datawindow.
Windows 10
Database Type:
Database Version: