- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-17-2022 10:52 PM
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 )
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2022 03:37 AM
like this
var val = current.variables.device;
var parser = JSON.parse(val);
obj.device_mac = parser[0].name_service + "";
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2022 02:16 AM
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2022 02:54 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2022 03:37 AM
Did I answer your original question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2022 03:37 AM
like this
var val = current.variables.device;
var parser = JSON.parse(val);
obj.device_mac = parser[0].name_service + "";
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2022 04:37 AM - edited 11-18-2022 04:38 AM
working perfectly fine.... Thank you so much @Ankur Bawiskar ...Thank you for your help..