Script Action Output (Array.String) output unable to map
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Hi Team,
I'm facing an issue in building a custom Subflow:
Script Action: Anti Crime Analytics Platform Access AD group manager
The Action:
1)Reads a catalog variable (approval_entitlement) from RITM.
2)Queries to custom table:
3)Plain Text table (u_ad_groups) In Adgroups records needs to be checked with the name(u_name) values needs to be compare with from approval_entitlement
4)Retrives (u_manager)
Script As per the Below:
gs.info('START_ACAP_ADGROUP_MANAGER_ACTION');
var managerMap = {};
var managerArr = [];
gs.info('RequestedItem:' + inputs.requested_item);
var ritm = new GlideRecord('sc_req_item');
if (!ritm.get(inputs.requested_item)) {
gs.info('RITMNotFound');
outputs.approval_managers = [];
return;
}
gs.info('RITMFound:' + ritm.getUniqueValue());
var entitlementStr = ritm.variables.approval_entitlement + '';
gs.info('ApprovalEntitlement:' + entitlementStr);
if (!entitlementStr) {
gs.info('ApprovalEntitlementEmpty');
outputs.approval_managers = [];
return;
}
var entitlements = entitlementStr.split(',');
gs.info('EntitlementCount:' + entitlements.length);
for (var i = 0; i < entitlements.length; i++) {
var entitlement = entitlements[i].trim();
if (!entitlement)
continue;
gs.info('CheckingADGroup:' + entitlement);
var grp = new GlideRecord('u_ad_groups');
grp.addQuery('u_name', entitlement);
grp.query();
gs.info('ADGroupCount:' + grp.getRowCount());
while (grp.next()) {
gs.info('ADGroupSysId:' + grp.getUniqueValue());
gs.info('ADGroupName:' + grp.getValue('u_name'));
var manager = grp.getValue('u_manager');
gs.info('ManagerFound:' + manager);
if (manager && !managerMap[manager]) {
managerMap[manager] = true;
managerArr.push(manager);
gs.info('ManagerAdded:' + manager);
} else if (manager) {
gs.info('DuplicateManagerSkipped:' + manager);
} else {
gs.info('ManagerEmptyForGroup:' + grp.getValue('u_name'));
}
}
}
gs.info('BeforeOutputAssignment');
gs.info('ManagerCount:' + managerArr.length);
gs.info('Managers:' + managerArr.join(','));
outputs.approval_managers = managerArr;
gs.info('END_ACAP_ADGROUP_MANAGER_ACTION');
Output variable defined:
When we are trying to map output hear the output variable is read only so Unable to map what was the reason why it's coming as readonly. Is something I'm missing or how.
But logs are coming with data correct basis on this I need to perform some other action in another subflow. Please let me know what I'm missing here.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
It would be helpful to see the part that isn't working for you - a screenshot of the Action Output showing the unmapped output(s), not in edit mode (so Exit Edit Mode from the last screenshot).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
Option is not coming to me when I clicked on data piller as per my expecations approvers manager will show case below the script step but it is not showcasing. Please check & let me know If anything I'm missing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
I'm not following. Either drag the Approval Managers data pill to the value box, or from that search dialog select 1 - Script Step then you should be able to select Approval Managers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
@Brad Bowman ,
For Approval manager output we need to map output one not the from the script step approval_managers.