Need to pass group member's sys id in Ask for approval Action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2024 08:04 PM
I have a custom action where i am fetching group member's sys id in an array .
For Example : ["84ffde55db78ef0001b2b5ca68961930","ad6749e61bd0c5d4e5044221b24bcbab"]
Now I need to pass it to my main flow " Ask for approval" action
when I am trying to do it getting an error like
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2024 08:11 PM
Hi Banani,
Group member sysIDs are not exactly User SysIDs, you may need to script to get users from the array.
Use a script step in your flow with:
var approvers = [];
var groupMembers = ["84ffde55db78ef0001b2b5ca68961930", "ad6749e61bd0c5d4e5044221b24bcbab"];
groupMembers.forEach(function(memberId) {
approvers.push({sys_id: memberId});
});
outputs.approvers = approvers;
Secondly, ensure in Ask for Apprpval step that Approval rule is set to Anyone can Approve or Reject
If my response proves useful, please mark it "Accept as Solution" and "Helpful". This action benefits both the community and me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2024 08:16 PM
Hi @banani1 ,
Why are you fetching group members through script, you can set that group in ask for approval using configuration.
You should avoid writing script if configuration is available to achieve your goal. or let me know your business requirement, based on that i will suggest you best solution.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2024 09:14 AM
This issue is related to PRB1813296. The problem is in relation to a group approval, but is the same error just for the user you are sending the approval to.