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
  • You can also create an expression rule with following input parameters and definition.

    Inputs : index(int), hireDates_DateArr (Date),firstNames_txtArr(Text)

    Rule definition :
    if(
    ri!hireDates_DateArr[ri!index] > todate(
    local(
    now()
    )
    ),
    ri!firstNames_txtArr[ri!index],
    null
    )

    Do apply on this rule when you have multiple hire dates and first names to filter.

    =apply(rule!aboveRule,{enumerate(length(ri!hireDates_DateArr)+1)},ri!hireDates_DateArr,ri!firstNames_txtArr)

    Note : todate(local(now())) gives exact today's date considering GMT time before 10 AM and after 5 PM.

    Please add appropriate null checks for hireDates, and firstNames.
Reply
  • You can also create an expression rule with following input parameters and definition.

    Inputs : index(int), hireDates_DateArr (Date),firstNames_txtArr(Text)

    Rule definition :
    if(
    ri!hireDates_DateArr[ri!index] > todate(
    local(
    now()
    )
    ),
    ri!firstNames_txtArr[ri!index],
    null
    )

    Do apply on this rule when you have multiple hire dates and first names to filter.

    =apply(rule!aboveRule,{enumerate(length(ri!hireDates_DateArr)+1)},ri!hireDates_DateArr,ri!firstNames_txtArr)

    Note : todate(local(now())) gives exact today's date considering GMT time before 10 AM and after 5 PM.

    Please add appropriate null checks for hireDates, and firstNames.
Children
No Data