In Flow Designer - how do add people to the watch list

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2021 09:26 AM
I am currently working on a new flow where it simply updates the record in the following 2 fields:
Assignment Group = xxxx (i know how to do this part)
Watch List = multiple people (cant seem to get this part to work)
My question is, how do you list out multiple people on this field. Is it by email, name, etc trying to keep this as low/no code as possible.
Thank you
- Labels:
-
flow designer

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2021 01:00 PM
Neither of those does as needed, does anyone know a script i can add/use to add multiple users to the watch list
When i go to set up the flow, i have it update a record>requested item record>fields is Watch List, you can use this button -- to add a script, (i have a feeling this is the only way it will work since the low/no code option doesnt seem to work as intended)
Currently it just has the generic script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2021 01:26 PM
Hey
Here's what you need.
Only now you need to be clear about the users you need to add to the watch list.
In this flow i had looked up for 2 records from the sys_user table in step 1 and 2 of the flow.
Hence in the code i have referenced _1_look_up_record & _2_look_up_record
Keep that in mind. And this one works -
If you need any further assistance please let me know

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2021 07:05 AM
Excuse my JS ignorance, do i change the "user1" or the "user1+" to the persons name or user ID in our system?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2021 08:23 AM
Let me explain :
var user1 = fd_data._1_look_up_record.record.sys_id;
user1 is just a variable declared to store the value of sys_id field of the user record (sys_user).
As i earlier mentioned, in my Action 1 & Action 2 of the flow i have looked up for random user records from the sys_user table, one user whose department is IT and other whose department is Customer Support.
Now that we have the user records referenced, we can use them using the fd_data object. It is the global object of the flow designer.
So, _1_look_up_record & _2_look_up_record; these record objects are created automatically.
You can refer to all the records from the previous actions using the fd_data object, just use the '.' operator (dot-walking) as shown below -
So again using dot operator we reference the fields of this record and we select the sys_id of the user.
Likewise for all users who are to added to the watch-list, create a variable and store the respective sys_id.
Now we just return the all the sys_ids but with a comma in-between. And in javascript a string needs to be declared in between ' '. That's why comma is declared in between - ','.
Also when we have to concatenate variables and strings we use + operator. thus every sys_id is preceded by a + operator and also the comma in-between (',').
Only the first sys_id is not preceded by a + operator, as you know when adding 2 numbers we require only 1 + operator and not 2. Hope, my explanation is clear and comprehensible.
Now you have to decide which users you want to add to the watch-list. If the user values are going to be static then you can just copy the sys_ids of them, separated by a comma, and return this string.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2021 10:07 AM