- 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-16-2024 12:40 PM
Hi, I would greatly appreciate any advice anybody has!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-16-2024 04:39 PM - edited ‎02-16-2024 06:10 PM
Hey @emorganisc,
I haven't seen this before but there is definitely room for improvement!
A few ideas that I can think of as a workaround:
- Use an 'If' statement to check if the user is part of the group, if not terminate Flow immediately
- Trigger Flow via Business Rule and validate if the user is in the group in the BR
Additionally, consider raising an Idea to ask ServiceNow to implement this functionality in the future release!
Hope it helps, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2024 03:33 PM
Thanks James, I tried setting it up in Flow Designer but it doesnt seem to work as you have it set up. I can't find a way to pull out group membership info from the group record, so there is no way to check against a user as part of a group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-19-2024 07:19 PM - edited ‎02-19-2024 07:25 PM
No worries @emorganisc,
Did you mean the 'Flow Variables > allowedUsers' data pill?
You can create a Flow Variable within the Flow Designer.
And then you can assign a value to it within Flow action
Thanks