The CreatorCon Call for Content is officially open! Get started here.

How to take string values from multi-row variable set to populate the Watch List on an incident

patricklatella
Mega Sage

Hi all,

this should be easy I would think, but something isn't working.  I have a record producer with a mult-row variable set with one variable (single line text) for capturing email addresses to be added to the incident's Watch List when the record producer is submitted.

How do I access the values in the multi-row variable set to populate the Watch List?  In the RP script i'm going with:

current.watch_list = producer.name_of_variable_in_variable_set; //variable in the variable set

Guessing there must be more to it?

thanks!

 

1 ACCEPTED SOLUTION

Hi Patrick,

I had some more time to fiddle with this and got it to work with the below.  There's something about the record producer script vs an RITM workflow script that is making the shortcut not work somehow - even though the array seems to be created correctly.

var emailArr = [];
var mrvs = producer.bkbmrvstxt; //internal name of your MRVS
for(var i=0;i<mrvs.v_email.length;i++){ //name of the variable in the MRVS
emailArr.push(mrvs.v_email[i]);
}
current.watch_list = emailArr.join(',');

View solution in original post

12 REPLIES 12

Hi Patrick,

I had some more time to fiddle with this and got it to work with the below.  There's something about the record producer script vs an RITM workflow script that is making the shortcut not work somehow - even though the array seems to be created correctly.

var emailArr = [];
var mrvs = producer.bkbmrvstxt; //internal name of your MRVS
for(var i=0;i<mrvs.v_email.length;i++){ //name of the variable in the MRVS
emailArr.push(mrvs.v_email[i]);
}
current.watch_list = emailArr.join(',');

Excellent Brad, it works!  thanks so much!

Megha Padale
Giga Guru

Hi Patrick,

Please refer this article this may help you:

https://community.servicenow.com/community?id=community_article&sys_id=5ebe74c0db2f00905129a851ca961...

If my answer is helpful to, please mark answer as helpful and correct.

Thanks and regards,

Megha.