Create Case from user uploaded JSON

Hi all,

I have a requirement - To create case from a User upload JSON file from a case worker portal. I have tried pxConvertStringToPage but this function needs JSON file content in string property. Could this be feasible please provide any suggestions?

Thank you

Edited by Moderator Kayla to update Platform Capability tags*

@skalidas What is the uploaded file format? Is it .json extension if yes then you can use the JSON Java library to read the json file and convert the json object to string and store it to a clipboard property when the file is uploaded.

@skalidas

Consider the Pega API. The /cases API will happily map JSON properties that match the properties of your case type data model. Check the Pega API option in the Help menu of Dev Studio. This would be ideal if there is a more natural channel for the user to be providing this JSON than in the Pega portal.

Alternatively, if you can predict the possible attributes that will be included in the JSON, in particular if those attribute names don’t match your case type data model, then you can now define a JSON Data Transform (a special type of Data Transform) that configures mapping rules how to map between a JSON object and a Clipboard page - in either direction.

We used @Base64Decode(.pyAttachStream) to get the file stream to String and @(Pega-RULES:Page).pxConvertStringToPage(tools, TargetPage, .JSONString,“json”) to map the String to Clipboard properties.