Have variables with the same name?

0
Is it possible to have two variables with the same name in a microflow? In my demo example below I have a decision. Depending on the path taken after the decision, the Test microflow will receive different inputs, and give different outputs, although they will always be of the same type (string). Later on in my microflow I want to use the output of the Test microflow but I find myself having to duplicate everything after the decision. Ideally I would like to be able to treat the output of the Test microflow as a single variable with the same name after my merge operation.  One solution I have thought of is described below, but is very inelegant and inefficient, especially in my actual use case which would involve extra paths for error handling. Is there a better way?  
asked
2 answers
0

when you add the decision in a submicroflow and then return either variable2 or 3 depending on the outcome, then call the microfo from the depicted microflow you will get 1 variable with the value of variable2 or 3 and then there is no need to duplicate the functionality.

You just make sure you return the result from the microflow.

 

answered
0

Hi Hartley Robinson,

 

what you have done is right.

 

As a part of optimization of microflow or to reduce the steps of microflow, you can do something like below.

 

Create a String variable in main microflow and change it in sub-microflows(as it will be available in sub-microflows too), then there is no need of returning the variable as output.

 

And as it is in the memory, the variable is automatically available and updated in main microflow

answered