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?
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:
You can reference the results by writing [Get manager approval].[Results]
.
Thanks for your quick reply. Sorry if I am missing something obvious but this is what I am testing:
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.
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.
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.
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.
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):
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.
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:
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
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:
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.
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.
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.
User | Count |
---|---|
43 | |
30 | |
24 | |
23 | |
13 |