How do I optionally save a custom data output to an array? A script task custom

How do I optionally save a custom data output to an array? A script task custom Data Output requires a target output, so if I try and use an if conditional like this: if(pv!newStaff.hireDate > today(),pv!newStaff.firstName,{}), I end up with a array index of blanks, when I really want no array index added. I want to be able to only add to array index if condition is met but as target output is required, it's saving a blank rather than do nothing as desired.

How can this be done?

Thanks

OriginalPostID-147849

OriginalPostID-147849

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    you could either:
    a) have a gateway that controls the process model flow and configure it so if pv!newStaff.hireDate>today() go to "scriptTaskToWriteToArray" else goto "nextScriptTask/skipWriteToArray".
    b) you can filter out the blanks of the pv in another script task using the reject function and re save into the array.
Reply
  • 0
    Certified Lead Developer
    you could either:
    a) have a gateway that controls the process model flow and configure it so if pv!newStaff.hireDate>today() go to "scriptTaskToWriteToArray" else goto "nextScriptTask/skipWriteToArray".
    b) you can filter out the blanks of the pv in another script task using the reject function and re save into the array.
Children
No Data