- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2024 04:50 PM
Hi all, I was wondering if it is at all possible in any sort of way to limit the "when to run" exclusion in flow designer for a trigger to a group of users instead of maintaining a list of cherry picked individual users?
- Do not run if triggered by the following users: Specify a list of users who cannot execute the flow.
- Only Run if triggered by the following users: Specify a list of users who can execute the flow.
Any advice is greatly appreciated, the current method of having to maintain this without groups is very frustrating!
Solved! Go to Solution.
- Labels:
-
flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 12:03 PM
That's no problem, you can create a TRUE/FALSE Flow Variable and set it to either true or false to indicate the 'updated_by' is part of the group. And you can use that within your IF Flow activity.
For example, you can refer to the following script for setting your true/false Flow variable
var runFlow = false;
if(gs.getUser().getUserByID(fd_data.trigger.request_item.sys_updated_by.toString()).isMemberOf(fd_data.flow_var.mygroup.getValue('name')))
{
runFlow = true;
}
return runFlow;
You can modify the script above with your parameters.
Then use IF Flow action like below
Hope it helps, thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 07:27 AM
That is exactly what I did, however, I that logic won't work when I test it. Here is my setup:
The issue is the "Updated by" field is just a string, and the allowedUsers is a reference record to a group. So there needs to be a way to iterate over a group's members to compare it to the "Updated by" string. However, I do not see a way to access a group's members via flow designer, which is a bit of a disappointment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 12:03 PM
That's no problem, you can create a TRUE/FALSE Flow Variable and set it to either true or false to indicate the 'updated_by' is part of the group. And you can use that within your IF Flow activity.
For example, you can refer to the following script for setting your true/false Flow variable
var runFlow = false;
if(gs.getUser().getUserByID(fd_data.trigger.request_item.sys_updated_by.toString()).isMemberOf(fd_data.flow_var.mygroup.getValue('name')))
{
runFlow = true;
}
return runFlow;
You can modify the script above with your parameters.
Then use IF Flow action like below
Hope it helps, thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2024 02:57 PM
Worked like a charm! Only modification I made was changing "request_item" to "current", otherwise, this is much more futureproof than what we were doing before. Hope SN responds to my idea, as adding this in the trigger when to run section saves a lot of hassle. Appreciate all the help James!