- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2024 02:44 PM
Is it possible to query the current total of group members in a specific group? For example im trying to figure out a way to incorporate a counter inside of flow designer. If the current count of a group is less than 100 as an example it would proceed with the next step under the flow. IF it is more it will go to a seperate approval. This would be handy for keeping tabs on your itil counts as we automate the assignment of the roles. Issue is that it can go over our allotted amount and thats why trying to incorporate a counter in the flow.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2024 03:55 PM
Hey @Tyler Johnson,
You can do this with without any coding in Flow designer.
Use the 'Look up records' (note the plural here) activity, e.g.
And use the 'If' Flow logic like below:
Hope it helps, cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2024 03:01 PM
Hi @Tyler Johnson ,
use a flow variable and set this using a script:
- Define a new flow variable. This could be called anything but for the sake of clarity I will use recordCount and set it as an integer
- Create a flow action to Set Flow Variables and select your newly created variable from the list
- In the data column press the Toggle for scripting button and use the below code
var grp = new GlideRecord('sys_user_grmember');
grp.addQuery("group", current.sys_id);
grp.query();
if( grp.getRowCount() >100){
retunr true;
}
else if(grp.getRowCount() <100){
return false
}
This will query the intended table with whatever query you set to get a count. The return line then populates the flow variable recordCount with the number of records. You can then use this data pill for the Max Records on your Lookup Records.
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-12-2024 03:55 PM
Hey @Tyler Johnson,
You can do this with without any coding in Flow designer.
Use the 'Look up records' (note the plural here) activity, e.g.
And use the 'If' Flow logic like below:
Hope it helps, cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-14-2025 09:56 AM
how do you list all users that are part of the group using this logic