- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 06:54 AM - edited 01-23-2025 09:12 AM
Hello all,
Please read my requirement below and advise on how to get it done.
Thanks In advance for reading my post till the end, appreciate your time.
I created a list collector referenced to u_cmdb_ci_ad_group table and a multi row variable set (active_directory_record_list) which is hidden on form and visible only on RITM after submission.
List collector
Multi row variable set looks like below
if any of AD Group has no secondary approver then it's automatically marked as Approved by some script ,and if there is a secondary approver then it's sent for approval to that person and that person might approve or reject.
once approval is done, in the next step i am sending a payload to OIM tool and in it sending approved groups.
currently i am sending all approved groups in payload , but customer wants to see only approved AD groups and not rejected one.
querying selected AD groups against cmdb_ci_ad_group table and finding display values.
adding all those groups in the payload.
in below screen shot highlighted group was rejected as shown in RITM (2nd screen shot above ), this should not go in the payload.
Please advise on how to get only approved groups and send it in payload.
Thank you so much for your time.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2025 10:26 AM
Hi Ankur,
I used the code you posted and modified it to below code, but it's throwing one error, not sure whats wrong in code, all variables are correct names.
var parseData = JSON.parse(fd_data._1__get_catalog_variables.active_directory_record_list.toString());
var approvedGroup = [];
for(var i=0;i<parseData.length;i++){
// use correct variable name and value to compare
if(parseData.approval_status.toString() == 'approved')
{
approvedGroup.push(parseData.u_select_group.toString()); // use correct group name variable within MRVS
}
}
return approvedGroup.toString();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 06:58 PM
I believe I answered your question as well based on what information you had shared.
I didn't know what that script include does as you didn't share code with us.
As per new community feature you can mark multiple responses as correct.
If my response helped please mark it correct as well 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
01-23-2025 09:19 AM - edited 01-23-2025 09:19 AM