E9.2 Orchestrator - How to override a variable

buster27

Member
Hello,

I have an orchestration where some variables are assigned out of a LEX component.
Then, later on, based on a rule, I want to override the value of the output variables from the previous LEX.
But I can't find a way to do that simply, as most of the components have different variables for input and output.
So I didn't find the component that would help me to simply pass the variable as an input then overrides the value inside the component and then
the same variable should be available as an output. So going forward, the modified value of the variables should be available.

Thanks for your help.
 
You can create another LEX component (or custom script) that simply assigns the value you want to a variable with the exact same name as the output of the first LEX. If the output variable name is the same then the second step will overwrite the value of the first in the same variable.

Hope this helps.
 
If you name it the exact same, as long as it's a top-level (not buried in array output for example) then it should just replace downstream.

You can check var values by looking at variable history in debug, it's a handy hidden feature
1699049285052.png
 
Don't forget that Orchestrations have explicit variables. You can output from a step into one of these then input it elsewhere as needed. This removes the confusion of associating a name with a step:

1700078186628.png
 
Variables are extremely handy. I use them a few of different ways.

First, you can use them like constants when you have a single value that you need to default into multiple steps in your orchestration. Create a variable, set your default, and use the variable in your orchestration. If you ever need to change that value, you only need to change it once.

Second, as this thread suggests, to track the latest value of a step output with the same name.

Third, for accumulating information when iterating over an array. In this scenario I have an array of data that I am iterating over and calling an orchestration to perform some action if certain conditions are met. Let's say I'm substituting a part on a work order and I want to keep track of the work order numbers I actually change. I create a variable called updatedWOs that is passed into my child orchestration as an input with the same name. In the child orchestration I add a custom request accepts the updatedWOs input and appends the latest work order that has been updated as a comma separated string. I return the new string as updatedWOs as an output in my child orchestration, which updates my variable. On the next iteration, the revised variable is passed in.
 
Back
Top