- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2025 06:49 AM
I am trying to implement an action in flow designer catalog workflow. I have a list collection (cmdb_ci)variable on the catalog form. In the flow- I would like to get the approval from each of the CI's Owner's selected on the form.
I tried the list collector to array and multiple other options, But it seem to be sending approvals again and again to the 1st CI's owner only instead of all CIs owners. Could someone assist on how can I achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2025 07:38 AM
Hi Chaithra,
Your issue likely seems from how Flow Designer is handling the list collector variable and iterating through the Configuration Items (CIs).
It appears that approvals are only being sent to the first CI's owner instead of iterating through all CI owners.
* Steps to Fix the Flow
1. Ensure the List Collector is Properly Parsed
In Flow Designer, ServiceNow stores list collector variables as a comma-separated string.
You need to convert this string into an array and iterate through it.
Fix: Convert List Collector to an Array
Add a Script Action before the "For Each Item" loop.
Use the following script to split the list into an array:
(function execute(inputs, outputs) {
var ciList = inputs.cmdb_ci_list || ''; // Get the list collector values
var ciArray = ciList.split(','); // Convert to array
outputs.ciArray = ciArray; // Return as Flow Designer output
})(inputs, outputs);
Store this array into a Flow Variable (ciArray).
2. Iterate Over Each CI Properly
Ensure your "For Each Item" loop correctly references the ciArray variable.
Inside the loop:
Use "Look Up Record" (on cmdb_ci) to get each CI details.
Fetch the CI Owner from the record.
Send an Approval request to the CI Owner dynamically.
3. Modify Approval Step to Reference CI Owner
Inside the loop, in the "Ask for Approval" action, dynamically set the approver:
Instead of using static values, reference:
$.record.cmdb_ci.owner
This ensures that each CI’s owner receives their own approval.
Final Flow Structure
* Script Action → Convert list collector to ciArray
* For Each Item in ciArray
* Look Up Record (cmdb_ci)
* Get CI Owner
* Ask for Approval (CI Owner from Lookup)
* If Approved → Continue
* If Rejected → Update Request & End Flow
* Expected Outcome
Now, each CI’s owner will receive an approval request individually instead of approvals looping over just the first CI’s owner.
This should solve your issue!
Kindly mark it as "Accepted Solution"/"helpful", as it resolves your query. Please press like button for the resolution provided.
With Regards,
Krishna Kumar M - Talk with AIT3ch
LinkedIn: https://www.linkedin.com/in/mkrishnak4/
YouTube: https://www.youtube.com/@KrishAIT3CH
Topmate: https://topmate.io/mkrishnak4 [ Connect for 1-1 Session]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2025 07:38 AM
Hi Chaithra,
Your issue likely seems from how Flow Designer is handling the list collector variable and iterating through the Configuration Items (CIs).
It appears that approvals are only being sent to the first CI's owner instead of iterating through all CI owners.
* Steps to Fix the Flow
1. Ensure the List Collector is Properly Parsed
In Flow Designer, ServiceNow stores list collector variables as a comma-separated string.
You need to convert this string into an array and iterate through it.
Fix: Convert List Collector to an Array
Add a Script Action before the "For Each Item" loop.
Use the following script to split the list into an array:
(function execute(inputs, outputs) {
var ciList = inputs.cmdb_ci_list || ''; // Get the list collector values
var ciArray = ciList.split(','); // Convert to array
outputs.ciArray = ciArray; // Return as Flow Designer output
})(inputs, outputs);
Store this array into a Flow Variable (ciArray).
2. Iterate Over Each CI Properly
Ensure your "For Each Item" loop correctly references the ciArray variable.
Inside the loop:
Use "Look Up Record" (on cmdb_ci) to get each CI details.
Fetch the CI Owner from the record.
Send an Approval request to the CI Owner dynamically.
3. Modify Approval Step to Reference CI Owner
Inside the loop, in the "Ask for Approval" action, dynamically set the approver:
Instead of using static values, reference:
$.record.cmdb_ci.owner
This ensures that each CI’s owner receives their own approval.
Final Flow Structure
* Script Action → Convert list collector to ciArray
* For Each Item in ciArray
* Look Up Record (cmdb_ci)
* Get CI Owner
* Ask for Approval (CI Owner from Lookup)
* If Approved → Continue
* If Rejected → Update Request & End Flow
* Expected Outcome
Now, each CI’s owner will receive an approval request individually instead of approvals looping over just the first CI’s owner.
This should solve your issue!
Kindly mark it as "Accepted Solution"/"helpful", as it resolves your query. Please press like button for the resolution provided.
With Regards,
Krishna Kumar M - Talk with AIT3ch
LinkedIn: https://www.linkedin.com/in/mkrishnak4/
YouTube: https://www.youtube.com/@KrishAIT3CH
Topmate: https://topmate.io/mkrishnak4 [ Connect for 1-1 Session]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2025 07:41 AM
Ya. I could make it work..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2025 08:01 AM
Hi Chaithra,
Thanks for accepting the solution provided and it worked at your end. That means a lot on supporting me. Please feel free to reach me, happy to assist.
With Regards,
Krishna Kumar M - Talk with AIT3ch
LinkedIn: https://www.linkedin.com/in/mkrishnak4/
YouTube: https://www.youtube.com/@KrishAIT3CH
Topmate: https://topmate.io/mkrishnak4 [ Connect for 1-1 Session]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-14-2025 08:13 AM
Hi Chaithra,
Kindly mark it as "Accepted Solution"/"helpful", as it resolves your query. Please press like button for the resolution provided.
With Regards,
Krishna Kumar M - Talk with AIT3ch
LinkedIn: https://www.linkedin.com/in/mkrishnak4/
YouTube: https://www.youtube.com/@KrishAIT3CH
Topmate: https://topmate.io/mkrishnak4 [ Connect for 1-1 Session]