Returning values from a process in automation -did anyone get it to work?

Erik_Ferm
Participant IV

I am trying to get my head around the new automation function. Most of it seems fine but I can’t figure out how to access values return by a process.

I have tried both

[name of process that generated the value].[name of variable]
and
[name of process that called the process].[name of variable]

When putting a formula is, the system also suggest a syntax which treats the name of the process as a table so

name of process[name of variable]

Does anyone know the right syntax and also what the scope of the variables is?

1 28 1,556
28 REPLIES 28

tony1
Participant V

Hi @Erik_Ferm. The syntax is [Name of call process step].[Name of variable].

So if you have a step called “Get manager approval” that calls another process:
3X_9_c_9c553428a9c689269505ec3efe3dd38bdc0bbd39.png

You can reference the results by writing [Get manager approval].[Results].

Erik_Ferm
Participant IV

@Tony,

Thanks for your quick reply. Sorry if I am missing something obvious but this is what I am testing:

  1. I have a process with a step called “calingStep”
  2. The step callingStep calls another process called “returningProcess”
  3. the process returningProcess has a step called “returningStep” which sets a variable called “tesVariable” to the value “variable text”
  4. The process step after callingStep is called “recallData” and it calls another process (that doesn’t do anything.)
    3X_e_3_e369b460adf8b91a017cea952a7ec5f95747ac75.png
  5. Before calling the dummy process, recallData sets the value of a column called scratch1 to a string which contains the variable from callingStep. This is done specifying the string as a process input.
  6. The syntax is accepted and the editor is happy with the reference to the variable.
  7. The column’s value is updated as expected but the variable from callingStep seems to be empty so it only enters the first part of the string.
    3X_e_a_eaf88e3853acf68c6f00f727568252d02f428a54.png

Sorry if I am slow but what am I missing here?

Can you show the details of what you’re doing in step 5?

Right now you can only use return values in if/else steps, call process steps, and return steps. It’s not currently possible to use the output of a process “inside” of an action (though it is on our todo list). @Dan_Bahir fyi.

Step 5 is calling a process and it is (trying to) use the variable as part of the process input, i.e. the columns that are updated before running the process.

So it is still in the process, not inside an action.

3X_5_6_56e32fc4c4eb653521b8237df07329fc493226bc.png

So the columns scratch1 for the row specified by id is set to

"This is the returned data: "&[callingStep].[testVariable]

Before running the process. As mentioned, the correct cell is updated but only with the text "This is the returned data: ".

Ah, that makes sense. Thanks @Erik_Ferm . You should be able to pass in that data, so it’s possible that this is a bug. I will share with the team to investigate.

referring to your screenshot in step two, I notice your Step callingStep is calling returningProcess as a lookup but has no process inputs. I understand this (perhaps incorrectly) as a parameter needed for a lookup.

FYI, I also noticed that passing a primary key input to a lookup process, if that record cant be found, instead creates a new record using the ‘looked for’ ID. Seems pretty much the same as the Add option for calling processes, so I’m not sure I understand this stuff.

Dan_Bahir
Participant V

Hi @Erik_Ferm,

I tried reproducing this scenario but I am not able to, I am getting the desired behavior.

Would you mind sending a request to support@appsheet.com asking to route the request to me. That would allow to to further investigate the app that you built and provide a solution for you.

No problem, I just sent the email.

Ferret
Participant V

What about

callingStep[testVariable]

OR

callingStep OUTPUT[testVariable]

They seem to be valid in the editor but I haven’t tested them out yet.

NOTE: Those both return lists so If a single value is being returned then wrap the above statements in an ANY() expression.

Ferret
Participant V

When attempting to use a return value, I cannot seem to get the editor to accept the syntax of

[Name of call process step].[Name of variable]

I can get the editor to accept (but it doesnt seem to work)

Name of call process step OUTPUT[Name of variable]


Main Process with calling step (uses SELECT to get id of row to lookup):





Called Process



NOTE: I’m setting this up for testing purposes only, so the logic behind this might not make sense (because I can grab svc ID with a SELECT statement and have no need to use a lookup)

I’ve determined this is due to the step that needs to referenced being inside a branching condition step. Syntax of:

[Branching Step Name].[Calling Step Name].[Result Name]

Does not seem to work.

In short, I can successfully reference a step’s returned values as long as the step IS NOT a part of a Branching step.

Support ticket in progress.

Ferret
Participant V

Here, this is definitely not confusing:

Thanks for sharing your findings.

I tested this a bit yesterday and also today. This is what I found so far:

  1. In my original app, all variables were returned as empty, regardless of how I referenced them.
  2. I then created a new test app with only one table, one bot etc and I got it to work
  3. I them made a copy of the app where the variables came back empty and, in the new copy, the variables were returned correctly without any change to the app
  4. In the app that I copied and where the copy worked correctly, the calling step and the retrieving step were both inside a branch condition
  5. This morning, sync times are really long and the bot stops after the calling step in all apps. This is true even if I don’t assign any value to any variables and don’t try to reference them
  6. In the diagnostics view, the event (just an update to a row) has the status “error” and the calling step does not show as having been triggered even though it has put data into a table. This is only this morning. Yesterday it was working

As for referencing the variables, yesterday I got the syntax

calling step Output[variable]

to work as well as

[calling step].[variable]

The editor will also accept

returningstep Output[variable]

but that returns an empty value.

I can still get what is supposed to work (aside from steps inside conditional steps) to work,

BUT I too am noticing that

AUTOMATION is UNUSABLY SLOW right now. Waiting over 5 minutes now for a saved record to trigger a single new record creation on a set of 3 records, a process that took just a few seconds yesterday.

This issue seems to be solved now

Former Community Member
Not applicable

Seems like an isolated issue, can you please let us know if you are still encountering the same issue?

Automation is no longer slow.

But

Return values from called processes still cannot be referenced if calling step is inside a conditional branching step.

Unfortunately, this issue has come back again. This is the problem:

  1. I set a number of Y/N variables in a sub-process which returns data
  2. I try to use them for a fork in a step below the calling step
  3. The variables are not defined when I try to access them as [calling step].[variable name]
  4. If I make a copy of the app (without copying the data), I can access the variables and the process works as intended without me changing anything in the app definition

Looking at the monitoring view, it appears that the variables are set correctly and the problem is in the branch step which looks like AND([callingstep].[var1], [callingstep].[var2] etc).

Hi Erik,

Do you mind sharing how you define your processes in details (the main one as well as the sub-process), possibly with screenshots?

Or you can email support@appsheet.com with details of your app and allow access to your apps – go to https://www.appsheet.com/account/account#_tab_acctConfig and check the option that enables support access.

We would like to investigate the issue.

Thanks!

Thanks for your reply. I emailed support and your colleague Brian said he would take a look at it.

In case this helps, I made a sample app demonstrating this issue and sent it into support 2 weeks ago (and I’ve periodically checked to confirm it has remained broken). The app is currently working and has a text explanation of the single change needed to demonstrate that a process within a branching process is not capable of being referenced, which breaks the app.

My Portfolio (Insect Terrarium)

The main Automation process contains two ‘lookup’ processes, one inside a branching process and another outside. A third process looks at one of those lookup processes and grabs a variable. Both lookup processes are the same process, just called in two places within this main process. The app currently looks at the process outside the branching conditional process. Change that with the formula provided in the app to the process inside the branching process to recreate this bug.

Does anyone know if this is fixed in any way. I’ve tried to simply get one process to return a value. Then a second process to read that and write it into a column. It simply just errors saying it can’t find:
[name of process that generated the value].[name of variable]

Also, this is a complete was of time. Just 4 lines are deveoted to the Return Values section

It sort of works. To access the variable set, you should probably use

[name of step that called the process that generated the value].[name of variable].

This seems to work most of the time. The scope of the variable is limited and I don’t think you can use it in a task for example. I understand that this is work in progress.

What I have had twice now is that it suddenly stopped working and the variables could not be accessed. Making a copy of the app (without copying data) fixed this.

This problem just occurred again.

I call a process to define variables and then I try to use them to store values in cell in the next step. The editor recognises the variable when I enter the formula and I can also see that values have been assigned correctly in the app monitor, but the content of the variables is gone when I try to store it in a cell.

Could you please try to figure out what is going on here? Variables losing their values makes automation significantly less useful.

I just heard back from Lusha from appsheet and this has been fixed now which is great.

Former Community Member
Not applicable

Don’t think you are using the right format. Please see this help article. The format is use the call process step name . return value. See explanation below:

In the screen shot the “Call Process” step name is “Send invoice for approval”, the process being called has a “Return values” step which is returning a value named “ApprovalDecision”.

So in the current process you would refer to that value as [Send invoice for approval].[ApprovalDecision] = “Approved” in the branch condition.

HTH.

Former Community Member
Not applicable

I am updating the help article with this image to make it more clearer.

That’s not the issue. A returned value from a process can be used in a following conditional step BUT does not seem to be accessible in a following call a process step.

Top Labels in this Space