- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-30-2025 05:32 PM
I've a spreadsheet with more than 100 folder names as one column and the other column contains approvers (different approver for every 1 or more folders ). I've built a table to store those folder names as String field and a reference field referencing user table for approvers. And in the catalog, I added a list collector variable referencing this folder table.
How to set Approver User activity based on the folders selected on the catalog? And should wait for all the approvals to open a task for fulfillment with only the approved folder access to fulfill.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2025 12:12 AM
if workflow then use this script
Also ensure it waits for Everyone to approve -> select this option
answer = [];
var selectedFolders = current.variables.u_sc_folder_access.toString();
var gr = new GlideRecord('u_folder_access');
gr.addQuery('sys_id', 'IN', selectedFolders);
gr.query();
while (gr.next()) {
var approverSysId = gr.getValue('u_folder_access_approver');
answer.push(approverSysId);
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2025 10:10 AM
you can use workflow IF activity and check this
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2025 02:22 PM - edited ‎03-31-2025 02:24 PM
I've used the below script but it's only checking if the first selected variable value starts with box and then only it's creating task after approval, if any other value selected it is going to the next check to create another task.
answer = ifScript();
function ifScript() {
var gr = new GlideRecord('u_folder_access');
gr.addQuery('sys_id', 'IN', current.variables.u_folder_name);
gr.query();
while (gr.next()) {
if (gr.u_srvr_drcty_name.startsWith("Box")) {
return 'yes';
} else {
return 'no';
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2025 07:58 PM
I believe I have answered your original question.
Please mark my response as correct and close the thread.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-31-2025 08:10 PM
Please enhance the script to check for all the variable values of that list collector
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader