Hi Team, In service operation Workspace under interaction record we have UI actions which is Create
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi Team, In service operation Workspace under interaction record we have UI actions which is Create Request , Create Incident, whenever click Create Request it will show interaction record agent name need to Auto populate in the catalog form Requested for field level?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Correct me if I'm wrong, do you mean that after you click on the Create Request button, the catalog form will open up and there you will find the 'requested for' field pre-filled with the agent name ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Thank you for your reply
yes , whenever click on the Create Request button, the catalog item selecting after that form will open then in the catalog form level 'requested for' field here need to auto populate agent name ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
Hello @AA6 ,
Here's how you can achieve it.
1. You need to go to the UI Action 'Create Request'. In the script section, at the end add this script:
var agent = current.assigned_to; //if there is any other field which stores agent name, replace assigned_to with it
var url =
'https://' + gs.getProperty('instance_name') + '.service-now.com/sp?id=sc_cat_item&sys_id=<sys id of the catalog item>&sysparm_requested_for=' + agent;
action.setRedirectURL(url);2. Create a catalog client script for the catalog item:
//Logic to set value from the url
var gUrl = top.location.href; //get the URL
//fetch the parameter
var setReq = new URLSearchParams(gUrl).get("sysparm_requested_for");
g_form.setValue('requested_for', setReq);[Note: make sure to add the catalog item sys id and change field names if required.]
This solution should work. Please let me know if it works or not and if it does, please mark my response helpful and accept the solution. Thank you
*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
31m ago
this is not going to work as the OOTB UI action is different
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
