JSON Array Flow Designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 02:02 PM
With the help of this lovely community, I am now able to gather an array (and store it) using JSON Parser and the object.array output:
var wsArray = [];
var item = JSON.parse(inputs.ResponseBody);
var totalWS = Object.keys(item.membership.workspaces).length;
for (var i = 0; i < totalWS; i++){
var wsObject = {};
wsObject.title2 = item.membership.workspaces[i].title;
wsArray[i] = wsObject;
}
outputs.wsname = wsArray;
I set up my output variables:
Here is my output from that script action:
{ "wsname": { "wsn": [ { "title2": "abc API Trial - Your first workspace" }, { "title2": "abc API Trial 2" } ] } }
But then on my output action, the output is:
[ { "title2" : "ICE API Trial - Your first workspace" }, { "title2" : "ICE API Trial 2" } ]
I'd like to create a flow that takes this data and for each title, create a record in servicenow. How do I do this?
Lisa
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-06-2020 04:55 PM
Hi,
Call this action from a parent flow, where you can use the titles from the object.
Below links might be helpful -
Regards,
Anirban

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-08-2022 01:05 PM
This is from 2 years ago. Not sure why it's randomly showing back up (in recent list -- and somehow shows an update of like 30 minutes ago), but putting this message here so others don't go through a bunch of effort to assist for something this old, unless it's still needed by the author.
Please mark reply as Helpful, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!