
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 01:50 AM
Hi,
Can anyone advise if there is a way to do this please.
We have a list field on a form, and we want to send a notification to the users in the list when someone new is added. However, we only want to send the notification to the original users in the list, and exclude the new user.
I have created a Before Update BR below which triggers the notification, but it sends it to the new user as well.
Is there a way we can exclude the new user from receiving the notification?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 02:52 AM
Hi @Cirrus , try this -
var pre = previous.watch_list;
var cur = current.watch_list;
var preArr = pre.split(',');
var currArr = cur.split(',');
var difference = new global.ArrayUtil().diff(currArr , preArr);
gs.eventQueue('test.notify',current,difference.toString());
This way, even if someone is removed from the list, a notification will not be sent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 02:16 AM
Hi Cirrus,
Leave the code from a second now, can you just explain how you differentiate original users and new?
What happens if I add users to that list 3 times.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 02:41 AM
Anurag, I can see where you are coming from. We are assuming that the 'submitter' would only lock the list once the 3 new users had been added and then save the form. If they saved after each addition, then I would expect the number of notifications to be 1, 1+1,1+2 for each user added. Looks like using previous.collaborators does what we need. Thanks for your time to look at this
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 02:20 AM
Hi @Cirrus ,
Can you try this - in the second line instead of 'current', use 'previous' (var getListusers = previous.collaborators.toString();)
(function executeRule(current, previous /*null when async*/ ) {
var getListusers = previous.collaborators.toString();
var splitusers = getListusers.split(',');
for(var i=0;i<splitusers.length;i++){
gs.eventQueue('collaborators.updated',current,splitusers[i]);
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2025 02:35 AM
Thanks, using previous does what we need. Now in reverse, is there a way to single out the new user so we can notify them that they have been added?