- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2025 12:46 PM - edited ‎08-06-2025 12:51 PM
I'm attempting to generate some number of approvals on a Requested Item where the Users, and the number of them, who need to provide approval, will vary with every run of the Catalog Item. I want all these users to have the approvals generated at the same time. Not serially where you have to wait for one to get the next approval request issued. If anyone on the list reject, the item is rejected. In the Flow that is triggered by the Service Catalog, I have gathered the sys_id of the user records into a comma separated list (string) as a Flow Variable. I have created a custom action that converts this list into a List of Records which, seems to be the only data type the Rules field accepts. For testing, these are valid/active users with at least the approver role. When the flow runs, none of the approvers are added and, the debug session shows Approval State "skipped" and I cannot figure out why. I cannot figure out why I get no approvers for the record in sysapproval_approver. I would like to use this method but, in attempt to make some progress, I removed that logic and replaced it with a GlideRecord script to insert the approvers in a for each item loop. All the approvals get created but, whether they approve or reject, the RITM is left with an Approval value of "requested" so, my Wait for Condition step waits. I'm not sure what else to try as I thought my initial attempt to use Ask for Approval, using an array of user sys_id, would work.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2025 10:38 PM
Hello @JamesLindsay
I'm back with more simple solution of scripted approvals
Here is how you can simply achieve this
1] Create a flow variable:
create a simple string flow variable
2] set the flow variable (here we will split the list collector to array of sys id)
add the following code using toggle script
var user_list= fd_data._1__get_catalog_variables.users.toString().split(',');
return user_list;
3]now add action as ask for approval
in the ask for approval, click on same toggle script and add following code
var approvers = fd_data.flow_var.variable;
return "ApprovesRejectsAnyU["+approvers+"]";
This will work like magic
you can add if condition to update the ritm based on approval or rejection
for any more refernece of scripted approvals, visit the following link:
Kindly mark this as helpful and accept this as solution if this helps
Thank you
Gaurav Vaze
Servicenow Developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2025 05:18 AM
I see my confusion and would have ended up here sooner had I not been so literal in my interpretation of the UI. It did not occur to me that the script toggle applied to Rule and the User field. I feel like a dunce having wasted a day and a half on this.
Thank you for waking me up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2025 06:34 AM
One issue I am having with this is that when any one of the four people I am seeking approval for approves, the other approvals are being set to No Longer Required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2025 06:53 AM
This works