Hi All,
I was wondering if there was a way, to extract JSON structure present in a text file. through a built-in function or a forge application in OutSystems. So I have this big JSON structure present in a text file, after adding the text file to the resources, I am scratching my head for ways to extract the JSON from this text file. Any help will be deeply appreciated.
Regards,
Shree Nandan Das
Shree Nandan Das wrote:
For that you need to create a structure in your module and than add JsonDeserialize block with the file contents and a structure. In the Data output parameter of JsonDeserialize you'll have all the json parsed to Outsystems structure.
Hi do not know if this will help you
You jave the ardojson in forge and you can try use jsondeserialize system action from outsystems.(probably you need to convert the resource before trying to deserailize it)
BR
Carlos Gonçalves wrote:
Hey Carlos,
JSONDeserialize takes in a text file and converts it into an OutSystems object. My JSON structure is present in a text file, still for some reasons OutSystems is unable to read it and I keep getting the 'Text data type required instead of Binary Data' issue.
Shree
Hi like Vitaly Martynenko and i said you need to convert the binary. You need to go to dependencies >> BinaryData and then BinarytoText action.
Thanks a bunch Carlos, got the solution.
Hi Shree,
can you please share the solution...i too have the same requirement and facing the same problem...
need to extract data from json file and store it in outsystem entity...
Thanks
DM
You might want to use BinaryDataToText function from BinaryData extension to convert Binary Data to Text.
Your code would look like this: BinaryDataToText(Resources.Test_txt.Content)
Vitaly Martynenko wrote:
Thanks Vitaly, helped a lot.
One good option is present in outsystems to generate structure from json text. Right click on structure under data tab. Then you will find an option "Create structure from json". Paste your json string and you will get the structure.