- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2025 11:29 AM
In a ServiceNow Flow Designer Action script step, I have an array of objects and I want to concatenate the values of a specific field (e.g., ‘transactoionId’) into a single string. How can I do that?
end production should looks something like [111,222,333] ( all numbers are transactioId's present in a array of object as shown on the image below .. Thanks very much in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2025 12:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2025 11:40 AM
Hello @gopijasti , What are the values present in transactionid, any example ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2025 11:54 AM
hi ,
the input feeding will look something like below :
[
transactionIds
{
"transactionId": 246202,
"typeOfRequest": "Add",
"priority": 0,
"tog": 16,
"employeeNumber": 909760,
"rule": "20",
"typeOfTimeOff": "V25-Vac 2025 Entitlement",
"length": "Full day",
"time": null,
"startDate": "8/5/25",
"startTimeHour": 0,
"startTimeMinute": 0,
"startTimePeriod": null,
"endTimeHour": 0,
"endTimeMinute": 0,
"endTimePeriod": null,
"isOverride": false
},
{
"transactionId": 246203,
"typeOfRequest": "Add",
"priority": 0,
"tog": 16,
"employeeNumber": 99760,
"rule": "206",
"typeOfTimeOff": "V25-Vac 2025 Entitlement",
"length": "Full day",
"time": null,
"startDate": "8/6/25",
"startTimeHour": 0,
"startTimeMinute": 0,
"startTimePeriod": null,
"endTimeHour": 0,
"endTimeMinute": 0,
"endTimePeriod": null,
"isOverride": false
},
{
"transactionId": 2464,
"typeOfRequest": "Add",
"priority": 0,
"tog": 16,
"employeeNumber": 99760,
"rule": "20256",
"typeOfTimeOff": "V25-Vac 2025 Entitlement",
"length": "Full day",
"time": null,
"startDate": "8/11/25",
"startTimeHour": 0,
"startTimeMinute": 0,
"startTimePeriod": null,
"endTimeHour": 0,
"endTimeMinute": 0,
"endTimePeriod": null,
"isOverride": false
}
]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2025 11:57 AM
Hello, @gopijasti try this
var parsedArray = inputs.parsedArray; // assuming this is passed as an input
var ids = [];
for (var i = 0; i < parsedArray.length; i++) {
var obj = parsedArray[i];
if (obj.transactionid) {
ids.push(obj.transactionid);
}
}
var concatenated = ids.join(",");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2025 12:27 PM
hi thank you,
i tried below and got null output . .