How to Split a Value that is in a Multi line Text field into new lines
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 12:00 PM
Hi,
I am fetching a value through a webservice ('parametes') which is "{"FirstName":"Rob","LastName":"Civitello","ID":"XXXXXX","Location":"XXXXXX"}". I want to split this value and display it in Mutli Line text field as follows
FirstName:Rob
LastName:Civitello
ID:XXXXXXX
Location:XXXXXXXXX.
Can some Please help me in spliting these and dispalying as mentioned.
Thanks,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 01:23 PM
It is simple. Try this.
var obj = JSON.parse('{"FirstName":"Rob", "LastName":"Civitello", "ID":"XXXXXX", "Location":"XXXXXX"}');
for (k in obj) {
gs.print(k + ':'+obj[k]);
}
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 02:04 PM
Sanjiv has already provided the solution, for more info, please refer: JSON Objects