
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2020 08:41 PM
Hi guys,
I have created a catalog item. So once i submit the item, i want to populate Requested for field on Request with the User field in the catalog item. How can i do that? I mean how to map catalog item fields to its Request fields?
Regards,
Indup
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2020 09:43 PM
Hi Indup,
There are two ways to do it.
One is if you have a workflow then after the Begin acitivty add a Runscript acitvity and paste the code there:
ar req = new GlideRecord('sc_request');
req.addQuery('sys_id',current.request);
req.query();
if(req.next()){
req.requested_for = current.variables.user; //current.variables.user is to read the user name from catalog form. same like opend, you can pick other variable value.
req.update();
}
Second way:
Create a after insert BR and copy the code there:
business ruel -- when -- After
Insert - true
Conditoin : - Item is your catalog item
script:
ar req = new GlideRecord('sc_request');
req.addQuery('sys_id',current.request);
req.query();
if(req.next()){
req.requested_for = current.variables.user; //current.variables.user is to read the user name from catalog form. same like opend, you can pick other variable value.
req.update();
}
Note: Replace the user with the user variable in your catalog item
Mark helpful and correct if it helps.
Thank,s
CB

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2020 08:46 PM
Hi,
I believe that functionality is already present.
Thanks,
Dhananjay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2020 08:58 PM
Hi,
I agree with Dhananjay but still if you are not getting that functionality ,you can share the screenshot of after submit form so that we can help you out.
Thanks,
Archana D.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2020 09:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2020 09:43 PM
Hi Indup,
There are two ways to do it.
One is if you have a workflow then after the Begin acitivty add a Runscript acitvity and paste the code there:
ar req = new GlideRecord('sc_request');
req.addQuery('sys_id',current.request);
req.query();
if(req.next()){
req.requested_for = current.variables.user; //current.variables.user is to read the user name from catalog form. same like opend, you can pick other variable value.
req.update();
}
Second way:
Create a after insert BR and copy the code there:
business ruel -- when -- After
Insert - true
Conditoin : - Item is your catalog item
script:
ar req = new GlideRecord('sc_request');
req.addQuery('sys_id',current.request);
req.query();
if(req.next()){
req.requested_for = current.variables.user; //current.variables.user is to read the user name from catalog form. same like opend, you can pick other variable value.
req.update();
}
Note: Replace the user with the user variable in your catalog item
Mark helpful and correct if it helps.
Thank,s
CB