Set requested for values based on catalog variable value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 05:43 AM
Hi All
We have a catalog variable called Username and based on the value filled in it the requested for should get populate on the sc_request form.
Currently its setting to the current logged in user by default.
Please help me to set the requested for based on the value filled in Username field.
Regards
Nandan

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2022 06:10 AM
Hi
You can follow this no-code approach in the field:
Catalog Data Lookup Definition on any table, eliminating Catalog Client Scripting
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2022 02:59 PM
Hi
Is your issue resolved?
Feel free to mark correct, if your issue has been resolved, so it ends up in solved queue.
Will be helpful for others looking for the similar query.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-16-2022 09:44 PM
Hi
requested_for field on sc_request is set to logged in user OOB
in the after insert BR on sc_req_item table do this
BR Condition: current.cat_item.name == 'Your Catalog Item Name Here'
Script:
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var req = current.request.getRefRecord();
req.requested_for = current.variables.username; // give correct variable name here
req.update();
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2022 01:14 AM
Hi
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader