- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Is there a way to add an action item or function to a record screen that allows the adding of users to the Watch List? Do I just make a sys_user reference field input or should it be done another way?
Solved! Go to Solution.
- Labels:
-
Now Mobile
-
Zurich
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I don't know why, but the original way I tried to do it worked like a charm after I was explaining it to someone else. Go figure!
The normal 'Update' type Action item works just fine for the Watch list.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Jaret Vik
Yes, you can add an “Add to Watch List” function in the Agent App, and the correct approach is to use the OOTB Watch List (Glide List) field, not a single reference field.
Below are the step-by-step instructions
Best Approach: Use Watch List + Action
🔹 Step 1: Verify Watch List Field
Go to your table (e.g., Incident or custom table)
Check if field
watch_listexistsIf not:
Create a new field:
Type: Glide List
Reference:
sys_user
Step 2: Add Field to Agent Form
Go to:
Workspace Experience → Form Layout (or Form Designer)
Add Watch List field to the form
Save and reload
Now users can directly add multiple users
Step 3: Create “Add to Watch List” Action
Go to System Definition → UI Actions
Click New
Configure:
Table: your table (e.g., Incident)
Name: Add to Watch List
Show on: Form / Workspace
Action type: Form button
Step 4: Add Script to Append Users
current.watch_list = current.watch_list
? current.watch_list + ',' + users
: users;
current.update();
action.setRedirectURL(current);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I need to add this function on the Mobile Agent App, not a form or workspace. I posted this question in the 'Mobile Apps & Platform' section.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Jaret Vik ,
Thanks for clarifying — since this is for the Mobile Agent App, the approach is different from Workspace/UI
You should not create a simple sys_user reference field. The Watch List is a Glide List (multi-user) field, so it needs to be handled accordingly in Mobile.
Recommended Approach (Mobile Agent App)
Step 1: Ensure Watch List Field Exists
Field:
watch_listType: Glide List
Reference:
sys_user
Step 2: Add Watch List to Mobile Screen
Go to Mobile Studio → Agent App
Open the Record Screen
Add field:
Watch List
Save & Publish
This allows direct viewing/editing if needed
Step 3: Create Action Item
Go to Mobile Studio → Action Items
Create new:
Name: Add to Watch List
Table: your table
Action Type: Script Action
Step 4: Add Input for Users
Add input:
Type: Reference → sys_user
(If multi-select not available, you may need to handle multiple selections via custom logic)
Step 5: Script to Update Watch List
vr rec = new GlideRecord(inputs.table);
if (rec.get(inputs.sys_id)) {
var existing = rec.watch_list ? rec.watch_list.toString() : '';
var newUser = inputs.user; // selected user sys_id
rec.watch_list = existing
? existing + ',' + newUser
: newUser;
rec.update();
}
})(inputs, outputs);
Step 6: Attach Action to Screen
Add this Action Item to your Record Screen
Place it in header/footer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Jaret Vik ,
You can create a UI Action button. This button can either instantly add the current user or logic (script) you can add for a user selection.
Sample:
- Navigate to System Definition > UI Actions.
- Click New.
- Configure the UI Action:
- Name: Add Me to Watch List
- Table: incident (or your desired table)
- Action name: add_me_to_watchlist
- Form button: Checked
- Client: false
- Script:
function addToWatchList() {
var userSysId = gs.getUserID(); var watchList = current.watch_list; if (watchList.indexOf(userSysId) == -1) { if (watchList == "") { current.watch_list = userSysId; } else { current.watch_list += "," + userSysId; } current.update(); gs.addInfoMessage("You have been added to the Watch List."); } else { gs.addInfoMessage("You are already in the Watch List."); }
}
