How to make a flow look at a table and then trigger approvals for users within that table?

thrsdy1512
Tera Expert

Hi I am creating a flow which is triggered when a catalog item is requested. This is  a simplified version of what I am trying to achieve:

  1. Request is looked > flow is triggered 
  2. Flow looks at team name variable 
  3. Takes the team name data and finds relevant entry for it in a associated table
  4. The table contains an approval group linked to that team 
  5. Flow generates approval requests for the requested item to that approval group.

It is the 2nd & 3rd point onwards I can't move past. How do you establish the link between the team name variable and the table? 

 

Thanks. 

1 ACCEPTED SOLUTION

Gaurav Vaze
Kilo Sage

Suggestion: create the team name variable as a reference to sys_user_groups which will make it easier

otherwise second approach should work

There are main 2 points to look into
1] If the team name variable is reference:

-simply use the Ask For Approval action

- select the record as your triggered record

- select the rule as Approve or Reject and approval rule as anyone approves or reject

- and in the field where we give the person or group, use the data pill picker to point your Team Name variable

GauravVaze_0-1731932962664.png

 

2] If the variable is a string

- use a lookup record action

- use table as sys_user_group

- add the condition as a name is {use data pill picker and drop your team name variable}

now handle the error because if there are no grp present then this action will throw an error

- if the record is found then you can use the ask for approval action and in the data pill picker(see SS, you can drop the lookup for record-> group record)

 

Mark it as helpful if it worked
     Gaurav Vaze
ServiceNow Developer

View solution in original post

2 REPLIES 2

Mark Manders
Mega Patron

Is your 'team name' a reference or a string? If it's a reference, your approval can just go to the team_record.approval_group. If it's a string, I hope the names are unique. You need to do a look up record to the team table where name is same as name in variable and then you can easily set the approval record to the approval_group of that record.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Gaurav Vaze
Kilo Sage

Suggestion: create the team name variable as a reference to sys_user_groups which will make it easier

otherwise second approach should work

There are main 2 points to look into
1] If the team name variable is reference:

-simply use the Ask For Approval action

- select the record as your triggered record

- select the rule as Approve or Reject and approval rule as anyone approves or reject

- and in the field where we give the person or group, use the data pill picker to point your Team Name variable

GauravVaze_0-1731932962664.png

 

2] If the variable is a string

- use a lookup record action

- use table as sys_user_group

- add the condition as a name is {use data pill picker and drop your team name variable}

now handle the error because if there are no grp present then this action will throw an error

- if the record is found then you can use the ask for approval action and in the data pill picker(see SS, you can drop the lookup for record-> group record)

 

Mark it as helpful if it worked
     Gaurav Vaze
ServiceNow Developer