Need to output array of records from an action
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-12-2024 01:48 AM
I'm experiencing that only sys_id gets outputted in Records output type.
From the documentation i've seen, i need to output only sys_id of record to array and pass that to output variable.
But when trying to get value from other fields in record, it's empty,
(function execute(inputs, outputs) {
var shiftGr = new GlideRecord("table");
shiftGr.addQuery('state', 108);
shiftGr.query();
var checked = [];
var shifts = [];
while (shiftGr.next()) {
//gs.info(shiftGr.new_owner.name);
var newOwner = shiftGr.new_owner.sys_id.toString()
if(checked.indexOf(newOwner) <= -1) {
shifts.push(shiftGr.sys_id.toString());
//shifts.push(shiftGr.toString());
checked.push(newOwner);
}
}
outputs.records = shifts;
})(inputs, outputs);
Labels:
- Labels:
-
Action Designer
-
flow designer
0 REPLIES 0