how to map variable set' variable value in watchList field on RITM

kumaraj
Kilo Sage

Hi Friends,

Please help me with my below requirement.

I have a list collector variable xyz in abc variable set. This variable refers sys_user table.

how can we map the users in xyz variable to watch_list field on RITM notes section (after submitting the request).

I guess we can create catelog client script on variable set and get the value of xyz variable and send to script include and then there we can map these value with watchlist.

I am unable to implement the code, so could someone please help me with the code.

Thanks

1 ACCEPTED SOLUTION

Thanks for the update Kumaraj. No worries. Below, please find the solution that I shared with you.

Create a Before business rule with Script as:

current.watch_list = current.variables.xyz;

Let me know if that answered your question. If so, please mark my response as correct so that others with the same question in the future can find it quickly and that it gets removed from the Unanswered list.

- Pradeep Sharma

View solution in original post

15 REPLIES 15

Mohit Kaushik
Mega Sage
Mega Sage

Hi There,

the easiest way to do this is to add a run script in your catalog workflow and take the values there from the variable list collector and set it to watch_list field on RITM table. So once your request i created it will be having the values in your watch_list field in RITM table.

 

Please mark this answer as correct and helpful if it resolves the query as per the impact

 

Thanks,

Mohit Kaushik

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Kumaraj,

I believe you will be having workflow for your catalog item you can use run script activity

sample script below

current.watch_list = current.variables.<listCollectorVariable>;
current.update();

Mark Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

he is using a variable in a variable set, not just standalone variable

Hi,

you can still dot walk variable in variable set in the above manner

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader