- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2022 02:46 AM
We have integration in place, where we are receiving data in JSON for Full Address as mentioned below.
"Full_Address": "Plac Andersa 5
61894 Poznan
Poland"
And we want to store this data as below in street field in ServiceNow.
Street :
Plac Andersa 5
61894 Poznan
Poland
Need to remove(
) from JSON and store into Newline as mentioned above.
Solved! Go to Solution.
- Labels:
-
Integrations

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2022 03:13 AM
Hi
You can try below example format.
var text = "Plac Andersa 5
61894 Poznan
Poland";
text = text.split("
").join("\n")
gs.print(text);
//it will print
Plac Andersa 5
61894 Poznan
Poland
Regards,
Sumanth

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2022 03:13 AM
Hi
You can try below example format.
var text = "Plac Andersa 5
61894 Poznan
Poland";
text = text.split("
").join("\n")
gs.print(text);
//it will print
Plac Andersa 5
61894 Poznan
Poland
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2022 05:29 AM
Thanks for your response
For Example :
"Naomi Building
National Highway Real
Calamba City
4027
Philippines"
Its giving below result.
Naomi Building
National Highway Real&#

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2022 05:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2022 01:02 AM
Its working fine in 'scripts - background'.
But i am using in Transform Map and its not working there in some cases. Target field in the transform map is Street(Field Type : Two Line Text Area).
I have written below code.
answer = (function transformEntry(source) {
// Add your code here
var a = source.u_full_address.toString();
a = a.split("
").join("\n");
return a;