Skip Approval for group if same person present in all groups

Aswin Chandras1
Tera Contributor

Hi All,

 

I have groups called A, B, C and D.

 

As of now approval is going to all the 4 groups. Now I need to check if the same user is present in all the groups then I need to skip all approvals if the user approves from one group.

For EX; if user A is present in all the groups and he approves it one time then it should skip other approvals and move the state to next state.

 

if the user is present only in one group then need to trigger all the 4 group approvals. I need to achieve this workflow.

1 REPLY 1

lpruit2
Kilo Sage

Greetings Aswin,

 

How are the original Approval requests being generated? Is this being done in Flow Designer or elsewhere? What is the Approval rules being applied when somebody is NOT in all 4 groups? 

I'm interested in hearing others proposed solutions but the only thing that comes to mind would be to have TWO pieces of logic to handle the overall approval process:
1. the original approval process (Flow Designer?) for when a user is NOT in all 4 groups

2. a new Business Rule that is sitting on the Approval table 


Business Rule: Unique Trigger Condition

The Business Rule that sits on the Approval table would need to have a unique trigger condition to avoid negatively impacting performance. You would only want this Business Rule to trigger for YOUR condition and only when the state changes to Approved. I would need to know more about the Target task record to offer any further guidance on an appropriate trigger condition.

 

Business Rule: GlideAggregate Query

Once you have determined how best to trigger your Business Rule, the only solution that comes to mind is to do a GlideAggregate COUNT of the "Group Members" table. You would be querying the passed in User who triggers the Business Rule and querying against all four of the Groups. After your query, you would do a .getAggregate on your COUNT and IF the number = 4, then you can fire off logic to mark all other Approval Requests as No Longer Required. 

I haven't tested any code and it most likely would-be best practice to NOT create Business Rules on the Approvals table but wanted to propose this as a possible solution.