- 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-17-2022 11:01 PM
if those variables within variable sets are not part of MRVS then syntax is the same and it will work fine provided the variable type and field type are same
1) let the variable be standalone or part of single row variable set the syntax to get value is same
current.variables.<variableName>
obj.device_mac = current.variables.name_service + "";
obj.device_hostname = current.variables.pass_value + "";
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 01:37 AM
i have done this but its not working...
no need to mention Variable set name (device) in the script..??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-18-2022 01:39 AM
not required if that variable is present in single row variable set.
I already mentioned the same above.
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:11 AM
for multirow variable set...??