How can I set the short_description field from the value of a single line text variable?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
I am attempting to set the value of the short_description of a sc_req_item from the user input when the RITM is submitted. The value I want to use from the RITM is a single variable and will be used in an email notification.
I have tried to use a BR to set the short_description and have tried a client script as well. I'm still pretty new to ServiceNow and am not familiar with all of the intricacies yet.
Any guidance or pointers would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thursday
what are you using flow or workflow?
please share screenshots and what did you try?
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
Friday
I haven't tried to use any flows as we are trying to keep all of our notification/actions tied to the configuration of the catalog item. I have tried the below BRs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
If you use a flow for the specific RITM, you can access the Catalog Variables in a task creation action. There you can set the value of any of the catalog Variables you created and map it to short_description.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Friday
you should use after insert BR on sc_req_item table
Condition: current.cat_item.name == 'Your Item Name Here'
Script:
(function executeRule(current, previous /*null when async*/ ) {
var shortDesc = current.variables.variableName;
if (shortDesc) {
current.short_description = shortDesc;
current.setWorkflow(false);
current.update();
}
})(current, previous);
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