I need to convert one line of Text to JSON.
Application Type
Reactive
Service Studio Version
11.14.16 (Build 60354)

I need to convert only one line of text in JSON not list.

I've read documents but didn't get anything.

Which JS I need to use?

Solution

Can you share an example of the Text you might put on the Text Area? The JSON deserialize also works for a single record. 

If the definition of the the JSON is dynamic, meaning that in the text area you can put different types of JSON, then you will have to process that in Javascript. You can use a Javascript Node, and use  "JSON.parse() " and output the result as an object:

But then I don't know how you want to use that object.

How are you going to use the result JSON on the OutSystems side? 

Don't meet your needs?


no maria it will take list that needs to be converted but I'm not having list 

just a text I need to convert.

Hello Saransh, 

Are you saying you want to isolate one line from a long text and turn it into a JSON? Do you want to convert it to a JSON in a Javascript node? What do you want to use that JSON for in OutSystems? 

You have the JSON deserialize action where you can convert a JSON in text form to a Structure on the OutSystems side.

Can you elaborate on your issue?


Best Regards,

Miguel Amado


I'm having a text area then whatever output I'm getting from that text area then that text ony I need to convert to JSON format.

Solution

Can you share an example of the Text you might put on the Text Area? The JSON deserialize also works for a single record. 

If the definition of the the JSON is dynamic, meaning that in the text area you can put different types of JSON, then you will have to process that in Javascript. You can use a Javascript Node, and use  "JSON.parse() " and output the result as an object:

But then I don't know how you want to use that object.

How are you going to use the result JSON on the OutSystems side? 

thanks miguel I think by this I got my answer.

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