Add users to watchlist via Flow Designer rather than replace existing ones?

Jonathan Demeul
Tera Expert
Good day, there is probably a simple solution to this, but in Flow Designer I have created a flow that updates the Watch List on the incident form. What I want to achieve is to add a user to the list of already existing users in the watch list, however when I use my flow it simply clears out any user that was in there and replaces is with just the one user_id I provided. How can I fix this that it adds the user rather than replace all the others?
 
find_real_file.png

This replaces all users in the watchlist with a single user. I guess that's what I'm asking the flow to do, but I want to be able to add upon the already exisitng users in the list basically.

Kind regards
1 ACCEPTED SOLUTION

Jonathan Demeul
Tera Expert

I feel stupid but I managed to solve this by looking up the record and replacing the watchlist with the datapill of the current watchlist + the datapill of the User ID:

find_real_file.png

That solved it.

View solution in original post

11 REPLIES 11

Maik Skoddow
Tera Patron
Tera Patron

Hi @Jonathan Demeulemeester 

as you already mentioned a simple data pill based assignment will overwrite the existing list in that field. You have to use then inline script variant. 

Please see the answers in the following question, which will point you to the right solution: https://community.servicenow.com/community?id=community_question&sys_id=97846855db81f41023f4a345ca96...

Another option is preparing a Flow variable and take its value for updating the record:

find_real_file.png

Kind regards
Maik

If my answer replied your question please mark appropriate response as correct so that the question will appear as resolved for other users who may have a similar question in the future.

Voona Rohila
Kilo Patron
Kilo Patron

Hi Jonathan

Try this in your field mapping script

var user1 = fd_data.trigger.current.watch_list; //existing watchlist users.

var user2 = fd_data.trigger.current.caller_id;//modify mapping accordingly.

return user1+','+user2;

Check below link

https://community.servicenow.com/community?id=community_question&sys_id=97846855db81f41023f4a345ca96...


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Jonathan Demeul
Tera Expert

I feel stupid but I managed to solve this by looking up the record and replacing the watchlist with the datapill of the current watchlist + the datapill of the User ID:

find_real_file.png

That solved it.

Hi @Jonathan Demeulemeester 

that is exactly the solution I have proposed to you 😞 

Please see my answer 4h ago.

Why didn't you recognize that?

Kind regards
Maik