- 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-07-2025 06:44 AM
Thank you for this response. I have considered a "temporary" group but, it would have to be dynamically created and then removed at the end of the flow. I hadn't gone there yet because it felt like using a very large hammer on a small nail; kind of messy to be creating objects and deleting them over and over again. There cannot be a single temporary group in this use case as there may be multiple threads of this flow executing, each with a different set of approvers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2025 09:52 AM
Where I say temporary group I meant creating a group,
Letter you can delete it
For each flow execution it will remain unique
You can name the group based on RITM
If you are ready to compromise the requirement of parallel approval procedure then it's easily solvable
But for requesting all users approval simultaneously, this is the approach which is easily achievable.
I'll look fro any other solution
Please post if you find any
Thank you
Gaurav Vaze
Servicenow developer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2025 12:57 PM
Hi @JamesLindsay ,
Please try your approach by maintaining the data in a Decision table and then fetching the record to trigger approvals using the 'Ask for Approval' action in flow designer.
If you are using a script, try to return the list as Array. Please refer to the below link and it might help.
https://www.servicenow.com/community/workflow-automation-blogs/scripted-approvals-in-flow-designer-w...
Please mark as helpful and accept the solution if it resolves your issue.
Best Regards,
Aniket Dey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2025 05:20 AM
Thank you for your response. This link is very insightful. I wish I could mark multiple responses as the 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