- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2022 08:48 PM
Hello,
I have a catalog item which contains a variable set called "Requested For Details Variables" (backend name: requested_for_details_variables).
I want to access the "Requested for" (backend name: rs_requested_for) variable from this variable set into the workflow to check the user name.
I have tried
current.variables.requested_for_details_variables.rs_requested_for.toString()
current.requested_for_details_variables.rs_requested_for.toString()
But nothing seems to work.
Please help.
Solved! Go to Solution.
- Labels:
-
Service Catalog
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2022 08:53 PM
Hi,
Try current.variables.rs_requested_for or current.variables.rs_requested_for.toString()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2022 09:05 PM
var mvrs = JSON.parse(current.variables.requested_for_details_variables);
for (var i = 0; i < mvrs.length; i++) {
var req_for = mvrs[i].rs_requested_for;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2022 09:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2022 09:22 PM
If rs_requested_for is a reference field, try current.variables.rs_requested_for.getDisplayValue() or current.variables.rs_requested_for.name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-10-2022 09:23 PM
Hi,
you can access variable value like this for variable which is directly present in catalog item or present in single row variable set.
current.variables.rs_requested_for
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader