VARIABLE SETS

shabbir9
Tera Contributor

HII

 

obj.device_mac = current.variables.device_mac + "";
obj.device_hostname = current.variables.device_hostname + "";   

 

iam mapping other application Fields to ServiceNow variables its working fine with this code but now i need to replace variables with variable set ..can anyone suggest how can i replace variables with variable set variables...(my variable set name is "device" and into this variable sets variable names are 1.name_service  2. pass_value   )

 

1 ACCEPTED SOLUTION

@shabbir9 

like this

var val = current.variables.device;

var parser = JSON.parse(val);

obj.device_mac = parser[0].name_service + "";   

View solution in original post

12 REPLIES 12

@shabbir9 

MRVS holds data in json format. so you need to parse it and get variable value

Did I answer your original question?

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

kindly give one example in my scenario if my variable set is MRVS ...(MRVS name is device & inside this variable is name_service)

obj.device_mac = current.variables.device.name_service + "";   

 

i tried this ..this is also not working

@shabbir9 

Did I answer your original question?

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

@shabbir9 

like this

var val = current.variables.device;

var parser = JSON.parse(val);

obj.device_mac = parser[0].name_service + "";   

working perfectly fine.... Thank you so much @Ankur Bawiskar  ...Thank you for your help..