How to add Variable set users in Notification.

sattar3
Tera Contributor

Hello All,

 

We got a requirement from customer like when RITM gets updated or any comments added in the RITM then an email notification will be send to User/Group Watchlist members.

 

For that I created a Variable Set, in that i have created 2 variables with list collector type.

1. User Watchlist-reference to user table.

2.Group Watchlist-reference to group table.

 

I have created a new Notification to sc_req_item table but i'm unable to select Variable set or variables inside variable set so that those members can get emails.

 

Please help me how we can achieve this and what are steps needs to be followed.

Can we achieve this by email script?

 

@Ankur Bawiskar @Community Alums 

 

Thanks,

Abdul

1 ACCEPTED SOLUTION

@sattar3 

why would the variable change later on? Ideally they should not once RITM is submitted.

It's not recommended.

you can use workflow run script to set the fields using the variables

Simply use this logic

1) when RITM is created populate the fields on RITM with the variable values -> workflow run script

current.setValue('watch_list', current.variables.users_watchlist.toString());

current.setValue('group_list', current.variables.group_watchlist.toString());

2) then have Insert, Update Notification and set the recipient as those 2 fields

AnkurBawiskar_2-1709900683715.png

 

3) condition is Comments changes

AnkurBawiskar_1-1709900631265.png

 

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

9 REPLIES 9

shyamkumar VK
Kilo Patron

@sattar3 ,

how are you trying to add the variables 

 

basically the syntax to call variables into notification is ${variables. VARIABLE_NAME} ,

Can you try with this

Regards,

Shyamkumar

 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar

Harish KM
Kilo Patron
Kilo Patron

HI @sattar3 there is no need to create new variables, there are 2 fields already on RITM which is "watch list" and "group list", you could use these fields to send notification, no code required, just add users and group to these fields and in notification who will receive, add these fields

HarishKM_0-1709868853174.png

 

Regards
Harish

@Harish KM yes fields are available but user using portal to raise a request, in portal those fields are not available because of that i created a new variable set.

 

Thanks.