Skip to main content
umeshkumars0001
Participating Frequently
Aug 9, 2021 12:24 PM UTC
Question

How to get sub process value in main process.

Hi All,

I have main process and calls sup process. Suppose sub process will iterate 10 time and each iteration it will generate new id. I want all new generated id by sub process in main process.

I have implemented output option in sub process but it return only last generated id by sub process.

It is possible to get all the id generated  by sub process in main process.

Regards,

Umesh 

    8 replies

    danny.verb
    Employee
    Aug 9, 2021 12:58 PM UTC

    Sub-processes can be tricky but work well when iterating through a list. When choosing to use 'multi-node instance' by iterating through a list, you can reference the list as a variable to pass into or save out to and Appian will smartly choose the correct index. If you know how many sub-processes you'll be creating, I recommend creating a variable of Integer which is a multiple and calling it Ids. You can use fn!enumerate() in a script task to quickly generate a list. Have the sub-process loop through this list and save your newly generated Id back to the list. 

    That should work, if it does not, consider passing the variable by reference, https://docs.appian.com/suite/help/21.2/Sub-Process_Activity.html#passing-a-process-variable-as-a-reference which means you don't need to save back to the variable since updates automatically persist to the parent process.

    umeshkumars0001
    Participating Frequently
    Aug 9, 2021 2:00 PM UTC

    Thanks  your reply Danny.

    it is possible without "multi node instance"?

    danny.verb
    Employee
    Aug 9, 2021 5:12 PM UTC

    Sure, what do you mean by 'sub process will iterate 10 times'? Are you forming a loop in the process?