- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-01-2024 10:29 AM
I'm using a datastream action and would like to use the "Action Preprocessing" section's "Script step" to set up some debugging. In the datastream action, I have checked the "Enable preprocessing script" box under "Action Preprocessing" and added the following to the "Script step" that appears under it:
(function execute(inputs, outputs) {
outputs.debug_employee_ids = gs.getProperty('sn_hr_integrations.workday_import_debug_emp_ids', '');
})(inputs, outputs);
Jumping down to the "Parsing" section's "Script Parser step", I have the following:
var worker = JSON.parse(inputs.sourceItem);
var debugIDs = fd_data._2__script_step.debug_employee_ids; //This was entered using the autocomplete feature of the script editor
if (debugIDs != '' && debugIDs.toString().indexOf(worker.employee_id) > -1) {
gs.info('Debug Workday REST feed - Employee ID ' + worker.employee_id + ': \n\n' + JSON.stringify(worker));
}
/*
....
*/
When I run this as part of a parent flow, it errors out in the "Script Parser" step stating the following:
For example, map incident record elements identified in the splitter step to a complex object containing incident fields. If the data stream includes siblings to the item identified in the splitter step that you do not want mapped to a complex object, include conditions to exclude those items.
- REST or SOAP step Response Body, Stream, or Error Message outputs.
- Splitter step outputs.
As far as I know, my situation is not excluded and fd_data should be accessible. Am I misunderstanding what the exclusions are? I don't want to put the gs.getProperty() call into the Script Parser step since that would perform the lookup each time instead of performing the lookup once, but I may have to if the data from the previous step is not accessible.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2024 07:44 PM - edited ‎10-22-2024 07:45 PM
Try this, prefix the object with 'inputs' as it is part of the input object.
inputs.fd_data._2__script_step.debug_employee_ids
This is not mentioned in the SN documentation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2024 07:44 PM - edited ‎10-22-2024 07:45 PM
Try this, prefix the object with 'inputs' as it is part of the input object.
inputs.fd_data._2__script_step.debug_employee_ids
This is not mentioned in the SN documentation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-25-2024 02:10 PM
Thank you! That was the piece I was missing. I can't wait until I do this again in 6 months and stumble into this same thread.