How "Return values from this process" work?

Hello,

I see that there is a step type “return values from this process” but it is not clear to me how it works.
I am able to create columns with a desired return value but how can I access them in a following step? Are they stored in a specific table?
Thank you.

3 23 4,765
23 REPLIES 23

tony1
New Member

Hi @Matteo_Menghetti, good question and thank you for the feedback.

You can access the results in the subsequent step using a formula like this: [Previous Step].[Value that was returned]. So for example, it would be [Get the approval].[Decision].

Is there a way to grab the value from from a decision of “Yes/No”?

Example: I did the

  1. Branch on condition

  2. CONTAINS([Email], “gmail.com”)

  3. If yes call an action that flags the contact as “Y”, if no flag it as “N”

It works great but can I have a single action that updates the value using the result of the conditional check, when I call action “Data: set values of columns in this row”

something like…[Previous Step].[Check if Email contains “gmail.com”]

I am not sure I understand the reasoning behind why you are trying to do this.

If you would like to set a column to the result of ‘CONTAINS([Email], “gmail.com”)’ you can have a data action that will set the result of that expression to a value of a column. There is no need to branch.

If you already have a branch because you need to do other logic you can just set the column value to “Y” in the yes branch and “N” in the no branch.

Let me know if this is what you are trying to acheive.

That make sense. I was kicking the tires and got some tunnel vision. I am curious about how people are using the for each, and other newer functions.

[Previous Step] is kind of a big deal in case anyone was wondering…

Thank you! I was able to make it work on a step of type Call another process but not on one of type return values from this process.
In the exemple here below I run an action called ADD PC, in this action I set a column called PC, I would like to return its value so I am calling [Add item row].[PC] but I have an error


3X_3_6_3698bbe0f7ae09f34b1ef452a471d563d64a85c5.png

Am I missing something?

Hi Matteo,

Thanks for trying out our new features.

Any changes that are made to the Entity (Row) that is in the context of the processed can be accessed directly. So if in the “Add PC” step you set the PC column in a later step when you reference the “[PC]” column it will have the updated value…

I apologize, the ForEach step is not yet fully available, however it leaked into the currently deployed UI. It will be removed shortly. When it is released we will provide full documentation so it would be easy for you to take advantage of.


If I have a return values as the last step in my process it blanks out add a step? Makes it extremely annoying that I have to add 2 steps then set the first one to be return value. Also how does return a value differ from just looking up the values in my next steps?

I spent hours first time today to examine Automation, but found it is quite difficult to understand.
This was first time to feel tons of difficulties to understand Appsheet features so far I learned amng others.

RETURN value step. In the programming, it means one particular function to return the value. If there is any subsequent steps, they will not executed, as return is sign of the end of process.
If we ended up steps with return step, then we need to move to another step, thats why I feel Appsheet is graying out the following step so that we are not allowed to add any more steps as it wont be processed. This was what I thought.

then as you rightly said, it is troublesome and painful we start to build up the separete process.
But today I faced the problem and difficulties to understand how to pass the previous process return value… On the premier document, return value is used for validation, to see yes and no.

If we think this new Automation as kinda of programming, my assumption was “returned value” could be a sort of variable, either local or global, so those value could be reachable through the new . dot notation.

I tested several time in different scenario how to get the returned value (variable) which was generated by the previous / parent process and push to child process, but I could not find it.

Either way, I found new Automation is quite difficult to understand and handle.

The current action/workflow set ups could be more easy and intuitive, at least to me.

This “Return Values” step, is it possible to have one process work on two different tables?

Specifically I’d like to be able to get a return value from a child record and then update the parent in the next step with a value from the child record. Is this possible? I would love some more documentation on this return values feature as it looks awesome, I only saw a small entry in the pdf for the automation release.

@Dan_Bahir

Former Community Member
Not applicable

@Ethan_U A process is bound to one table(entity) and all its steps have access to a row of data for that table. Assuming you have a reference (either as a ref column type or having the correct value) to the parent record in the child record, you can implement your use case using two processes. Process C (which has the child record) can use a “Call Process” step to invoke (using the Lookup option) Process P (which works on the parent record). Process P can have a data action task that updates some part of the parent record. I have posted a quick sample here.

Wow very cool thank you for taking the time to do that @prithpal very kind of you

I understand this so far but for your “Process P” how to I pass the values from the Child Record to the Parent. In your example you just used a NOW() function and didn’t use the values from the Child in the data action task.

If you could help me w this it would be awesome.

@prithpal

Former Community Member
Not applicable

3X_4_2_425e31afe49cbd115a3648f194cdb7ae9a9fd8a9.png

You can add any fields you need updated below the Id field (in the Lookup option). eg: In this screen shot you can see how “Description” (in Process P, Parent table) will be updated with the “Item Code” value (in Process C, from the child table). HTH.

Ok I’m doing my best to understand and feeling quite dumb for not being able to do this. If you’re willing here are some screen shots of what I’m doing so far.

This is the first part of your process, when a daily task record is changed it triggers the process called “PROCESS DAILY TASK” which calls another process called UPDATE MASTER TASK (the parent) The ID for the MASTER TASK record is the ref column from the Child DAILY TASK record.

And here is the next part. In the expression boxes next to the MASTER TASK fields I only have fields corresponding to that table? How can I use the values from the DAILY TASK table then?

Sorry I’m trying my best to understand

i agree with what he said.

Hi @Ethan_U ,

If I understand correctly you have a parent process that takes a daily task and you want to update the corresponding master task with some data of the daily task.

Maybe this trick will help, if you noticed the call process step allows you to lookup a row from the [MASTER TASK] table by an Id. It also allows you to update any of the other fields of that row by clicking the ‘Add’ button and providing an expression. Here you have the context of the DAILY TASK so you can use that.

In the child process you can have other steps you might need to send email/notifications…

Let me know if that helps.

Another option if you dont need to do additional step in the child process is to use the data action task “Add row to another table”. If the row already exists then this action will update it, it does require thought that you provide all the required columns.

I am curious to hear which option works best for you.

@Dan_Bahir Thank you for your tips. I got it work. But sill have some questions.
Imagine a Shop. You add a product to the Cart and set an amount.
By adding a row, a Bot is fired. Via Call a Prozess I am able to change the amount in the Stock Table.
So when I add an item to the Card with amount = 2, the Amount in Stock Table will be subtracted by 2.
That’s perfect.
But what if I don’t add a new item, but change the amount of an existing item? I thought I could use [_THISROW_BEFORE] / [_THISROW_AFTER], but I always got an error. Seems like we cannot use this in bots? How would you do this?

@prithpal

This is working now. I can use [_THISROW_AFTER].[Amount]-[_THISROW_BEFORE].[Amount] in Call a Process.


@Fabian_Weller wrote:

[_THISROW_AFTER].[Amount]-[_THISROW_BEFORE].[Amount]


This is no more working. Please see my post here:

https://www.googlecloudcommunity.com/gc/Tips-Tricks/Call-a-Process-with-THISROW-BEFORE-and-THISROW-A...

This is working again by a fix from the AppSheet Team. Thank you!

Top Labels in this Space