cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Defining variables that are based on other variables in the same action

tshoemaker
Deputy Chef III
Deputy Chef III

When defining new variables, sometimes it is necessary to define VariableONE, and then define VariableTWO as something that was dependant on the results of VariableONE. For Example:

VariableONE = "ABC"

VariableTWO = VariableOne + "DEF"


I know that you can do this in two separate tasks, but I was wondering if this could be done within one task since you can create multiple variables within on task.

4 REPLIES 4

rituraj
Deputy Chef I
Deputy Chef I

can be done but the result is not what you want. Since variableONE is being initialized and default value supplied in the same step , variableONE does not get the value till the step completes. Not sure what could be the use case for this - in the same step?

The use case... if i am extracting a piece of data into a variable that will be reused, and then I want to use that same varialbe to build another variable as well. IF i have to do this in two tasks, it proliferates tasks. I want to reduce the task load.


rituraj
Deputy Chef I
Deputy Chef I

ok understand. Based on my test , VariableONE will still be nil or null till that step completes but maybe there are other ways.. BTW , if you have a really large recipe with lot of steps, try breaking it into multiple callable functions - modular.

mppowe
Executive Chef I
Executive Chef I

@tshoemaker  if this isn't already an Idea, you should submit it b/c I've wished for the same, and lamented the fact that I had to spend extra tasks for it. 

https://ideas.workato.com/app/#/user/suggest?currentProductId=caf1efdf-1d7e-4b7b-aeb9-28e4b0f4b25c