Why the request for field is populated with the current login user
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2023 04:27 AM
When I created a new catalog item request, the request for field of the sc_request table is populated automatically with the current login user instead of the taking the value from the request for variable. How can I make sure that this field will populate automatically with the request for variable from the catalog item. Again, Im talking about sc_request table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2023 10:55 PM
@Ankur what do u mean by workflow run script? can I do it using BR?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-16-2023 11:03 PM
are you not having workflow or Flow for your catalog item?
If yes then you can add logic in it.
Why to create extra BR for this?
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-16-2023 11:19 PM
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 09:08 PM
@Ankur Bawiskar @Prince Arora Im still getting the error, maybe its because of other BR? Should I share all the BR that related?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-17-2023 09:53 PM
I already shared the BR script yesterday
are you using the same?
you should use after insert on RITM
var ritm = new GlideRecord('sc_req_item');
ritm.addQuery('sys_id', current.sys_id);
ritm.query();
if (ritm.next()) {
if (!JSUtil.nil(ritm.variables.requested_for)) {
ritm.requested_for = ritm.variables.requested_for;
ritm.update();
}
}
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader