How to write an expression rule that returns multiple values?

How to write an expression rule that returns multiple values? Would you share an example?

  Discussion posts and replies are publicly visible

Parents
  • Creating a dictionary on before returning. Then you can reference those values via index().

    XXX_getVariableAndLocation()

    with(
        local!tempVariable: rule!XXX_processVariable(), /*** FOR EXAMPLE: RETURNS 5 ****/
        local!variableLocation: rule!XXX_getVariableExpression(),
        {
            value: local!tempVariable,
            location: local!variableLocation
        }
    )

    Main Expression

    load(
       local!variableDetails: rule!XXX_getVariableAndLocation(),
       index(local!variableDetails, "value", null)
    )

    Output is 5.

     

Reply
  • Creating a dictionary on before returning. Then you can reference those values via index().

    XXX_getVariableAndLocation()

    with(
        local!tempVariable: rule!XXX_processVariable(), /*** FOR EXAMPLE: RETURNS 5 ****/
        local!variableLocation: rule!XXX_getVariableExpression(),
        {
            value: local!tempVariable,
            location: local!variableLocation
        }
    )

    Main Expression

    load(
       local!variableDetails: rule!XXX_getVariableAndLocation(),
       index(local!variableDetails, "value", null)
    )

    Output is 5.

     

Children
No Data