- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 04:49 AM - edited 11-29-2022 04:53 AM
Hello ,
I want to copy user(reference field to user table) to ritm watchlist on submitting request.
I have referred https://www.servicenow.com/community/it-service-management-forum/auto-add-to-watchlist/m-p/914649/pa...
but i get org.mozilla.javascript.NativeArray@c8b0cc in watchlist
Please help me to fix this.
Thanks
Soumya
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 05:52 AM - edited 11-29-2022 05:52 AM
Try adding toString() at the end, as shown below. Most of the time it works.
current.watch_list = current.variables.person_to_be_copied.toString();
Mark answer as Correct or Helpful based on impact.
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 05:56 AM
Hi @soumya17,
Try this updated lines in your business rule. It will work.
current.watch_list = current.variables.person_to_be_copied.toString();
current.update();
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 05:41 AM - edited 11-29-2022 05:42 AM
I wrote business rule after->insert on ritm table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 05:52 AM - edited 11-29-2022 05:52 AM
Try adding toString() at the end, as shown below. Most of the time it works.
current.watch_list = current.variables.person_to_be_copied.toString();
Mark answer as Correct or Helpful based on impact.
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 05:59 AM
No 😞 @Abhijit4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 06:23 AM
It actually worked isn’t it. Just you didn’t add current.update() in after BR
Regards,
Abhijit
ServiceNow MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2022 06:25 AM
yes update i didnt add.
It worked.. Thankyou