- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 03:15 AM
Hi All,
We are in the situation where we need to send approvals dynamically to the groups. like we have 'ABC' company then we need to send approval to the 'ABC Approver'. We have 100+ companies and user can select the company value while raising the request using variable 'Requested for Company'.
We have written below script and it is working fine.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 05:02 AM - edited 07-30-2024 05:05 AM
I would suggest you to create a custom table extended from "dl_matcher" table. On this table, you could hold company and approval matrix.
Then on the form, you can create a list collector variable to hold approval information. (This will be hidden variable) Assuming you have company information available on the form already.
You need to create data lookup definition for your catalog Item. Matcher Table will be your custom created table. Matcher variable will be your company and setter variable will be the hidden variable you created. For more information : https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/field-admini...
Lastly, on the workflow you could write below code on Approval activity to trigger approvals.
var answer = [];
answer.push(current.variables.<variable_name_of_list_collector> ;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 04:20 AM
Hi @Milind1 ,
Why don't use Parent child relationships, Find out the parent company from the child company and use the above existing logic??
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 05:02 AM - edited 07-30-2024 05:05 AM
I would suggest you to create a custom table extended from "dl_matcher" table. On this table, you could hold company and approval matrix.
Then on the form, you can create a list collector variable to hold approval information. (This will be hidden variable) Assuming you have company information available on the form already.
You need to create data lookup definition for your catalog Item. Matcher Table will be your custom created table. Matcher variable will be your company and setter variable will be the hidden variable you created. For more information : https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/administer/field-admini...
Lastly, on the workflow you could write below code on Approval activity to trigger approvals.
var answer = [];
answer.push(current.variables.<variable_name_of_list_collector> ;