- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
I have a requirement, there is a table in which i have a field called record _user of list type, i want to add user in the field using flow without removing other users and also if i remove any user through flow only that user should remove.
Does anyone have idea how to do that?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
See below working example for adding
enhance it for removal
var currentWatchList = fd_data.trigger.current.watch_list.toString().split(',');
currentWatchList.push(fd_data.flow_var.usertoaddremove.toString());
return currentWatchList.toString();
For removal use this script
var currentWatchList = fd_data.trigger.current.watch_list.toString().split(',');
var indexToRemove = currentWatchList.indexOf(fd_data.flow_var.usertoaddremove.toString());
currentWatchList.splice(indexToRemove, 1);
return currentWatchList.toString();
Output: Working for addition
Output: Working for removal
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
you can use flow variable of type String and store sysId of the user which needs to be added/removed
Then use "Set Flow Variables" flow logic and use script to append/remove only that user by accessing the field value.
Then use "Update Record" flow action to update that list type of field with the Flow variable
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
See below working example for adding
enhance it for removal
var currentWatchList = fd_data.trigger.current.watch_list.toString().split(',');
currentWatchList.push(fd_data.flow_var.usertoaddremove.toString());
return currentWatchList.toString();
For removal use this script
var currentWatchList = fd_data.trigger.current.watch_list.toString().split(',');
var indexToRemove = currentWatchList.indexOf(fd_data.flow_var.usertoaddremove.toString());
currentWatchList.splice(indexToRemove, 1);
return currentWatchList.toString();
Output: Working for addition
Output: Working for removal
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
