Need to change "requested for" for catalog items
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 07:11 AM
Hello Everyone,
I have a problem with service catalog whenever any one requested on behalf of any other user. Then after raising the request it will set requested for as the the requestor not "on behalf of user"
Variable set is also fine see the below picture see the attachment,
The question what need to be set so that when i select another user and raise the request then it need to set the requested for as the user for whom i raised the request "on behalf of user" not my name.
Please suggest if any one have solution of that issue.
Thanks in Advance
Abhishek Rai
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 07:18 AM
Hi
In your workflow after the begin activity, you can add a run script activity and add below script
current.requested_for = current.variables.requested_for;
current.update();
Mark as correct and helpful if it solved your query.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2022 07:50 AM
Hi Abhishek
Requested for field on RITM is dot-walked field from req so we need to update req record.
Try this
var req= current.request.getRefRecord();
if(req.isValidRecord()) { // << only perform operations on it if it's a valid record
req. = current.variables.requested_for;
req.update();
}
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
‎07-26-2022 07:53 AM
Hi,
are you saying requested_for on REQ shows logged in user? If yes then that's platform behavior.
You will require script to update it
Use after insert BR on RITM table or you can use workflow run script in your catalog item's workflow
Script would look like this
var req = current.request.getRefRecord();
req.requested_for = current.variables.requested_for;
req.update();
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
‎07-27-2022 09:55 PM
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