Flow Designer to get the UserIDs

Vasu2
Tera Contributor

I have a catalog variable with a Dropdown field called 'Name', each Selected Name will have different userIDs associated with it in its Reference table in another string field called Description. How we can send the approvals for all the userIDs at a same time based on the selected Name dropdown. Here we do not have direct field on the catalog Item for Description Field.

2 REPLIES 2

Medi C
Giga Sage

Hi @Vasu2,

 

You can use Get Catalog Variables flow action to get the Variables.

You can create a flow variable where you can store the sys_ids of the users

You can set the users sys ids (comma separated) in this flow variable

In Ask for approval action in your flow, you can use the following script: (This will approve or reject if any user approve or reject)

var approvers = fd_data.flow_var.users;
return "ApprovesRejectsAnyU["+approvers+"]";

 

You can take a look at the following if you would like more custom approval rules:

https://www.servicenow.com/community/workflow-automation-blogs/scripted-approvals-in-flow-designer-w...

 


If you found this helpful, please hit the thumbs-up button and mark as correct. That helps others find their solutions.

AparnaSahu
Tera Guru

Hi @Vasu2 

I think this is possible, but it will require some scripting.

You'll need an identifier like userID or sys_id as the backend value of the choice field. Then, you can query the sys_user table to find the user and push them for approval.

If you prefer a low-code approach, use the Lookup Record action. Select sys_user as the table, check against the field value (sys_id), and pass the result to approval.