871
Views
9
Comments
Solved
Reading JSON structure from .txt file
Question

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

2024-07-29 13-18-02
Vitalii Martynenko
Solution

Shree Nandan Das wrote:

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.

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.


2018-10-17 18-00-19
Carlos Gonçalves

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

2018-11-05 08-37-10
Shree Nandan Das

Carlos Gonçalves wrote:

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

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.

Regards,

Shree


2018-10-17 18-00-19
Carlos Gonçalves

Shree Nandan Das wrote:

Carlos Gonçalves wrote:

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

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.

Regards,

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.


2018-11-05 08-37-10
Shree Nandan Das

Carlos Gonçalves wrote:

Shree Nandan Das wrote:

Carlos Gonçalves wrote:

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

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.

Regards,

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.


2019-10-04 15-01-22
Dhiraj Manwani

Shree Nandan Das wrote:

Carlos Gonçalves wrote:

Shree Nandan Das wrote:

Carlos Gonçalves wrote:

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

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.

Regards,

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


2024-07-29 13-18-02
Vitalii Martynenko
Solution

Shree Nandan Das wrote:

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.

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.


2024-07-29 13-18-02
Vitalii Martynenko

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)

2018-11-05 08-37-10
Shree Nandan Das

Vitaly Martynenko wrote:

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)

Thanks Vitaly, helped a lot. 


2018-12-01 17-54-01
Sourav Pasari

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.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.