Use 'Call a process' and 'Return values' steps in automations

The AppSheet Help documentation explaining the Call a process and Return values step types in automations is minimal and mostly abstract. In the community, there are myriad posts seeking or even suggesting clarification, but I've not found any sufficiently helpful explanations. In case it's of use, here's a concrete description of one way I found to use these step types.

Scenario

I have an automation that creates a new row in a parent table using some values from an existing row in the same table. That part is straightforward. I need the automation to also create associated rows in a child table--i.e., copy and associate to the new parent row all the child rows associated to the original parent row. In order to do that, I need the newly created parent row's key, which is automatically generated using the UNIQUEID function in an Initial value expression.

I used "Call a process" and "Return values" to get that ID value from the newly created parent row. By creating the new parent row using a "Call a process" step (e.g., instead of the basic "Add new rows" data change action), I have a way to designate a value to be returned--namely, the new parent row's key. Then, I have that key value to reference in creating new child rows in a subsequent step.

Return values step (in child process)

It's a little counterintuitive in term of the automation authoring process, but you first need to create the process containing the "Return values" step so that it's available to select in the "Call a process" step that will ultimately precede it in the automation workflow.

Create a process for the table where the row will be created; ensure the process has linking enabled. The process can include just a single step--i.e., "Return values". For each value that you include to return, the name you assign can be referenced in the parent process's subsequent steps.

dbaum_0-1672502029838.png

 

Call a process step (in parent process)

In your main process, create a "Call a process" step and select the process you created that includes the "Return values" step.

dbaum_1-1672502408729.png

Subsequent steps (in parent process)

Reference the returned value(s) using familiar dot notation with the syntax [step-name].[return-value-name].

dbaum_2-1672503432293.png

Note: The AppSheet Help article's specification (at the time of this posting) to use [child-process-name].[return-value] results in an error from the app editor when saving. Again, what does work is [step-name-from-parent-process].[return-value].

5 2 932
2 REPLIES 2

@dbaum Thank you so much for this tip.
https://www.googlecloudcommunity.com/gc/AppSheet-Q-A/How-quot-Return-values-from-this-process-quot-w...
This post helped me back then, but your post is a good knowledge base 😀

Thank you @dbaum 🤗

Top Labels in this Space