- 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 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 08:46 AM
Hi @Ankur Bawiskar ,
This script is working good. I've another challenge here. Once approved, I need to do a condition check to open one or two SCTASKS based on the list collector values selected. If list collector values selected starts with only AA, then only one SCTASK, if it starts with other than AA, then also only one SCTASK but to different assignment group. When it starts with AA && other like BB, two SCTASKs should open. Also I need to show only those values under the variables section in respective SCTASK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2025 09:07 AM
Glad to know that my script worked.
I believe I have answered your original question.
Please mark my response as correct and close the thread.
The discussion can still continue on the answered thread.
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 09:08 AM
you can use Lookup Record on the table being referred by list collector
Then use IF logic to check if the value starts with AA or BB
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 09:11 AM - edited 03-31-2025 09:28 AM
I am using the workflow since flow designer won't fulfill few of the requirements. how to do this in the standard workflow?
Also the Approver user activity is not moving forward if one of the approver rejected for a specific folder access (bcoz of Everyone to approve wait). I would like to have the task still opened with only the approved ones.