- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2021 11:03 PM
Hi All, We have a catalog item created and after submitted it will go for 2 levels of approval and once the approval is done it will create a task in the task the short description is mandatory field and in short description we need to get the catalog item name: requstedfor : user ID. we need this details in short description field. How to get these details please suggest.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2021 11:14 PM
Hi Ashwini
In your catalog task activity , use below code in script section.
var desc;
desc += "Item Name :"+current.cat_item.name;
desc += "Requested For :"+current.request.requested_for.getDisplayValue();
desc += "Requested For :"+current.request.requested_for.user_name;
task.short_description =desc;
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2021 03:18 AM
Can you share few screenshots.
Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2021 03:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2021 10:24 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2021 11:18 PM
Within the task activity of the workflow, you have the option to add script as an advance step. You can set the values of all the task field.
task.short_description =current.variables.variablename;
Regards
Vinayak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2021 11:34 PM
Hi,
general syntax to access any variable within catalog item workflow is this
current.variables.<variableName>
If that is reference variable then ensure you use getDisplayValue() to get the name and not sys_id
var variableValue = current.variables.<variableName>.getDisplayValue();
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader