- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2020 12:51 AM
Hi All,
How to populate Request Company field in Requested item and catalog task. I have added run script core activity in workflow to populate request company field. So the same company is to populate in both requested item and catalog task.
Regards,
Sruthi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2020 12:06 AM
Hi Sruthi,
please add these 2 lines in each catalog task activity advanced script section for whichever task you want it to be populated
var company = current.request.company;
task.<companyField> = company;
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
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
06-04-2020 01:15 AM
Hi Sruthi,
In the very first run-activity you can store the value use
workflow.scratchpad.locis=current.variables.variable_name;
Then use in the sctask activity code as below
task.locis=workflow.scatchpad.locis; //locis is a field on Catalog task table
For RITM use run-script use below
current.locis=workflow.scratchpad.locis//locis is a field on RITM table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2020 01:18 AM
Hi Sruthi,
Is the company a variable on catalog item? what is the type of variable?
you want that to be populated on Catalog Task and RITM?
Do you have location field on RITM and SC Task table to hold this value?
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
06-04-2020 01:20 AM
Hi Ankur,
Company is request form field. Not Catalog item variable.
Regards,
Sruthi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2020 01:35 AM
Hi Sruthi,
how company field on Request is populated?
I assume you are having some default value for this
please have this code to update company on RITM table
Sample script for workflow run script on Catalog item
var company = current.request.<companyField>;
var ritm = new GlideRecord('sc_req_item');
ritm.get(current.sys_id);
ritm.<companyField> = company;
ritm.update();
when task is created you can use this in the advanced script section in Catalog Task activity
var company = current.request.<companyField>;
task.<companyField> = company;
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader