Bug 4764

Feature Request: Dw.ExportJSON() defining columns and capitalization 13 January, 2021

Product: PowerBuilder Category: DataWindow
Version: 2019 R2 Build: 2328
Classification: Enhancement Publishing: Public
Priority: P3
Status: Transferring Reason:
armando herrera @Appeon 13 January, 2021
Hi Yiannis,

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 you can always open another ticket any time you need it.  

Ken Guo @Appeon 09 June, 2020
Hi Yiannis,

For this new requirement, I suggest you open a new ticket in this support system so that we could better trace and handle it.

Yiannis Papadomichelakis 09 June, 2020
Hi Ken.

Thank you for considering my proposal. I would like to add one more thing.
There are cases when a datawindow column contain JSON data. It would be great if that data can be exported as part of the JSON string and not a string value.
This can be a huge plus for us!
Ken Guo @Appeon 08 June, 2020
Hi Yannis,

Thanks for reporting this problem and for your suggestion. 
We'll transfer this enhancement to our product team for consideration. 

Chris Pollach @Appeon 08 June, 2020
Hi Yannis, 

   Thank you for that enhancement request. I have now marked this ticket as such.

   Your idea of a template feature in the DWO for importing and exporting JSON data is indeed a worth while request IMHO. Using the same technique as the DWO already does for XML would be a logical JSON extension feature for the DW object.

Regards ... Chris
Chris Pollach @Appeon 08 June, 2020
*** Bug 4765 has been marked as a duplicate of this bug. ***
armando herrera @Appeon 08 June, 2020
Hi Yannis, 

Thank you very much for your report. We are working on it and we will get back to you after analyzing it.

We'll keep you posted here!

Yiannis Papadomichelakis 08 June, 2020
Dw.ExportJSON() exports all the columns of the datawindow. Some datawindows contain many columns that we don’t want to export, either because we want smaller payloads or because we don’t want to expose sensitive data.
I understand that we can always use temporary datawindows/datastores with only the rows/columns we want to export, however I feel that this may be something that will make some people not to use the JSON features.

Exporting / Importing XML is performed using templates, which is a nice approach and gives you 100% control for what to export and how.

My ideal approach to this problem, would be to add another optional parameter (on ExportJson) what will be an array of strings, with the names of the columns to export.
You can also go further than that, by using this array for the names of the exported JSON elements.
For example, if the datawindow contains the columns code and label and I want to create a JSON string with the elements Code and Label, I could use the same array to define that. Since dw columns are case insensitive, you will have no problem finding the proper columns but you can use the array’s capitalization to create the JSON string.
Windows 10
Database Type:
Database Version: