- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 05:14 AM
Hi Team,
On sending data from script include using JSON.stringify(arr),we are getting message as [{}] ,we are only sending single value for a scenario.
But when we print the value before JSON.stringify , we do get the proper message in gs.info() as "Carrier" .This value is not getting sent using stringify
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 05:52 AM
Hello @Community Alums
use :-
JSON.stringify(arr.toString());
Plz Mark my Solution as Accept, if you find it Helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 06:39 AM
var fixedByChoice = JSON.parse(answer);
var nameArr = fixedByChoice.split(','); // add these line after above one.
for(var i=0; i<namesArr.length;i++){ // replace your for loop with mine
// ur code
}
Plz Mark my Solution as Accept, if you find it Helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 06:39 AM
var fixedByChoice = JSON.parse(answer);
var nameArr = fixedByChoice.split(','); // add these line after above one.
for(var i=0; i<namesArr.length;i++){ // replace your for loop with mine
// ur code
}
Plz Mark my Solution as Accept, if you find it Helpful.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 06:30 AM
its working now
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 06:30 AM
@Community Alums
why would you use toString() on arr while using stringify?
Can you explain?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2023 10:41 PM
@Ankur Bawiskar Yea it was incorrect. My Bad. Now its working