- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 02:19 AM
- Created a variable named "priority" in catalog item as type (Select box)
- Added choices as High, medium and low with values 1, 2 and 3.
When submit the catalog item form with priority choice according the value, Requested item (sc_req_item) "priority" field should change. How can I implement that ?
(Catalog item priority field)
(Requested item priority field)
(Note: The "priority" field in Requested item (sc_req_item) is not read only)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 02:37 AM
Hello,
You can use a BR (On create) to update and map cat_item priorities with sc_requested_item. Idealy you can use the same values for both and hide options that you don't need
(function executeRule(current, previous /*null when async*/ ) {
// If cat_item choices == sc_req_item choices
current.priority= current.variables.priority;
//else If cat_item choices != sc_req_item choices
var priority_map={"high": 1,"low": 5};
current.priority= priority_map[current.variables.priority];
})(current, previous);
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 02:55 AM
Thank you for marking my response as helpful.
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
04-17-2023 04:14 AM
I believe I too answered your question by sharing multiple approaches.
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