Scope
A scope is a namespace for variables. Think of it as a group of variables.
You can think of scopes as a filing cabinet. ποΈ
Just like a cabinet draw that houses certain set of information, API AutoFlow has scopes to house certain set of data
Server scopesβ
This scope only resides within the server being configured.
In the case of HTTP, you have a request scope which includes the original request. You also have a variables scope which is free for you to store whatever values you want.
Workflow scope and Action outputβ
Each action has an output field where you can define where you would like to store their results for later use, by default it is stored in the OUTPUT variable: output
.
You can change the output to another variable.
Three output tabsβ
There should be 3 tabs:
- Action Field Value (input): Shows what values were resolved for the input
- Action Output (output): What the result was for the action
- All Workflow Data (data): All the available data to choose from
Iteration Scopeβ
Iteration action scope exists only inside the iteration action. Iteration scope can not be accessed after the iteration is complete.
Common mistake with scopeβ
Scope is simply a "scope for variables". But it can get a little confusing at times.
Let's for example, if you want to edit a piece of nested data, try doing it like the second action in the image below. Basically, you do an object/put action on a nested variable and writes it back to that same position OUTPUT variable: output
.
Here, if you forget to change the output location, it doesnβt get written to the right location and this can get confusing.
If your data starts getting complex, try storing the data in a differect variable name.