Index from scriptask output

Hi everyone, 

I have a scriptask which create an output of type text by running an expression rule, which looks like below: 

I save this output into a process parameter, then plan to use it for the sub-process. 

 If I want to take the updatedRelationship of the current process instance, what the script should be like? 

I tried below code but the data does not pass into sub-process... do I need tp!instanceIndex for the process to know what data to pass into its subprocess?

index(pv!scriptaskOutcome,"updatedRelationships",tp!instanceIndex, null)

Thank you!

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Appian Employee
    in reply to mollyn126

    In this case you aren't using the option for "Automatically run multiple instances of this node", so the tp!instanceIndex variable won't have a value.

    It's still unclear to me what you are trying to do - are you trying to create a different sub-process for each item in your list of "updatedRelationships"? If so, then you need to check that box above and then tp!instanceIndex will work. If you're not doing that, are you trying to pass a certain index (e.g. the first item)? If so, you can just hardcode 1 into your index() function above. Or another option is you can just pass the entire list into the sub-process and use it there however you need to.

Children