Run transformation/data source from flow designer when RITM is approved
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi Experts,
I am trying to run the data load after the approval of RITM, using custom action script to do data load but its not working, flow is working till approval after approval no transformation is triggered. added a variable as data source sys_id using this variable to load the data source sys_id, attaching the screen shots and the script below
custom action script
(function execute(inputs, outputs) {
outputs.import_set_sysid = '';
outputs.message = '';
outputs.success = [false];
outputs.ActionStatus = {
Code: -1,
Success: false,
Message: ''
};
try {
if (!inputs.data_source_sysid) {
outputs.message = 'No data_source_sysid provided';
outputs.ActionStatus.Message = outputs.message;
return;
}
// Step 1: Load Data Source into an Import Set
var loader = new GlideImportSetLoader();
var importSetSysId = loader.loadDataSource(inputs.data_source_sysid);
if (!importSetSysId) {
outputs.message = 'No Import Set created. Check file on Data Source: ' + inputs.data_source_sysid;
outputs.ActionStatus.Message = outputs.message;
return;
}
outputs.import_set_sysid = importSetSysId;
// Step 2: Run all active Transform Maps on the Import Set
var transformer = new GlideImportSetTransformer();
transformer.setImportSetID(importSetSysId);
transformer.transformAllMaps();
outputs.success = [true];
outputs.message = 'Transform triggered for import set: ' + importSetSysId;
outputs.ActionStatus = {
Code: 0,
Success: true,
Message: outputs.message
};
} catch (ex) {
outputs.success = [false];
outputs.message = 'Exception: ' + ex.message;
outputs.ActionStatus = {
Code: -1,
Success: false,
Message: outputs.message
};
gs.error('Load+Transform Action failed: ' + ex);
}
})(inputs, outputs);
please help resolve this issue, thanks in advance
please help resolve this issue, thanks in advance
0 REPLIES 0