In Flow Designer, could I use a condition - If record exist

JLeong
Mega Sage

Good day,

I am trying to create a Flow Designer so that when a user is added as a Group Manager it will automatically assign rota_admin role. However, I want to check first if the Group Manager  already has the role, if so no action is needed, otherwise, it will add the role.

find_real_file.png

 

After the trigger, I created a Record Look Up to check sys_user_has_role table (if Manager already has rota_admin) When it doesn't find a record it errors out and the next step is not ran.

I think there is a better way to do this in the Flow Designer.

Please assist.

Thank you!

 

 

1 ACCEPTED SOLUTION

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Jleong,

 

Please use the action "Look up records and not look up record" and then add the if block to check user count. Based on the count logic you can grant the role to the user. Sample screenshot attached for reference.

find_real_file.png

 

-Pradeep Sharma

View solution in original post

3 REPLIES 3

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Jleong,

 

Please use the action "Look up records and not look up record" and then add the if block to check user count. Based on the count logic you can grant the role to the user. Sample screenshot attached for reference.

find_real_file.png

 

-Pradeep Sharma

Thank you so much Pradeep! You're the best 🙂

Hi Pradeep,

 

Sorry to ask another question, I know you're busy too, but I would like to know if there is a way in Flow Designer to determine the previous value before it was updated.

Example:

If I change the group manager from Joe Smith to Peter Lee, I need to add roles to Peter Lee and I also need to remove the roles from Joe Smith.

Thank you!

Regards,