Flow designer for adding group members in Incident watch list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2024 03:21 AM
Hello all,
I have a check box field in INC form, once it is checked then all the members from a specific group should be added to the watch list, of that incident, this needs to be done through a FLow designer.
Please help me out, I have tried in PDI but I could get only a single group member added in the watch list and not all members.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2024 08:01 AM
Please find the screenshots of the flow I have created and the testing part, I have added 4 members in a group and the flow is adding only 1 member of the group out of 4 members.
1.
2.
3.
4.
5.
6

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2024 06:09 PM
@Mohammed Daiyan You need to slightly tweak your flow here, as a first step create a flow variable of type array or string, You will update the value of this flow variable using Lookup records and add user sys_ids to it with each iteration (array.push('sys_id') or str=str+user.sys_id+',') after Lookup records action you can use the Update record action to update the watchlist of the incident with this flow variable.
Essentially the flow variable will be a comma separated list of user sys_ids. In your current implementation the watchlist variable is getting overwritten by each iteration due to which it only contains single user from the last iteration.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-10-2024 09:18 AM - edited ‎09-10-2024 09:21 AM
It sounds like you have the right idea, but are replacing the Watch List with the sys_id every iteration of the loop you are using.
This can be solved with a little bit of scripting.
Code:
return (fd_data.flow_var.user) ?
(fd_data.flow_var.user + ',' + fd_data._2__for_each.item.sys_id) :
(fd_data._2__for_each.item.sys_id);
Using a ternary operator instead of a if/else block.
You should use a Flow Variable so that you don't need to update the Incident for every iteration of the loop.
Note: You can also use the same concept to 'add' users to the Watch List instead of 'replace' the entire Watch List.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 04:02 AM
Hi John,
Thanks for replying, I tried adding the flow variable and adding the script to it, but could not get all the group members added to the watchlist.
Please check the below screenshots, I have tried adding the different datapils for the watchlist, but I am not sure which shall work correctly.
Please help me out.
1.
2.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-11-2024 04:02 AM
Hi John,
Thanks for replying, I tried adding the flow variable and adding the script to it, but could not get all the group members added to the watchlist.
Please check the below screenshots, I have tried adding the different datapils for the watchlist, but I am not sure which shall work correctly.
Please help me out.
1.
2.