- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi,
First time posting - I am looking for guidance how to correctly script a custom short description that shall pull the variable display text values correctly.
The variables: for simplicity renamed to "var1" and "var2"
What I have right now is currently throwing "undefined" errors:
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @danielalexa ,
If it is a Reference variable, you can use dot-walking to retrieve the display value. Assuming the Requester variable references the User table, you can use:
fd_data._1__get_catalog_variables.requester.name
If it is a Select Box variable, you can dot-walk through the RITM to retrieve the variable's display value. In the example below, we are accessing the RITM through the Flow Trigger and then retrieving the display value of the variable:
fd_data.trigger.request_item.variables.<varname>.getDisplayValue();
If you find this information useful, please mark it as Helpful and Accept the Solution.
Regards,
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hello @danielalexa ,
With flow designer you can achieve this use case :
Suppose you have a catalog item called License Request with these variables:
| software | Reference | Microsoft Office |
| license_type | Select Box | Premium |
Step 1: Trigger
Create/open your Flow.
Use:
Trigger → Service Catalog
Step 2: Get Catalog Variables
Add an action:
ServiceNow Core → Get Catalog Variables
Step 3: Create the Catalog Task
Add:
ServiceNow Core → Create Record
You can customize the short description then after the submission of catlog item output will look like this:
If you found this Helpful please Accept the Solution and mark it as Helpful.
Thanks,
Prajakta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
what's that variable type for var1 and var2?
your logic is correct
did you add those 2 variables to right side while using "Get Catalog Variables" flow logic?
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Yes, the first action of my flow is to get all variables added.
Both variables are simple select boxes with question choices. What I need from the "getDisplayValue()" is the 'Text' and not the 'Value' - yet the above so far throws "undefined" for both.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @danielalexa ,
If it is a Reference variable, you can use dot-walking to retrieve the display value. Assuming the Requester variable references the User table, you can use:
fd_data._1__get_catalog_variables.requester.name
If it is a Select Box variable, you can dot-walk through the RITM to retrieve the variable's display value. In the example below, we are accessing the RITM through the Flow Trigger and then retrieving the display value of the variable:
fd_data.trigger.request_item.variables.<varname>.getDisplayValue();
If you find this information useful, please mark it as Helpful and Accept the Solution.
Regards,
Harish
