How to use the same variable from different sequence

Hi All,

How do use the same variable in different sequences of the same Main.xaml ?
I have a flowchart in which I have created 5 sequences in it. I had created a variable in say sequence1 and want to use dat in sequence5 .
I am not able to do it even though the scope of variable is set to flowchart itself.

Any suggestions?

you should be able to use it if the scope is for the full flowchart …what is the error you are facing?

Hey!

Use arguments if you’re using invoke workflow!

Else

Change the scope of that variable to Flowchart you can use that variable globally.

Regards,
NaNi

Hi @Abc_Xyz1,

Can you share your flow?

Regards,
MY

I am not getting any error. I just want to use the same variable at its value in the sequence2.

Yes I did change the scope to flowchart. The data am getting from Excel and just assigned it to a variable in sequence1. So when I wanted to use the same thing in sequence2 its value is blank

I might not be able to share the flow

Hello.

The solution is to pass the variable to the outside scope.
However, validate pf if you didn’t create the variable in duplicate, within each sequence and also, validate if it was not created in the arguments separator.
Hug

Hey!

Don’t set any default value to that variable!

For example:-

In sequence one I’m reading excel output as-> dt_out

I can use this variable globally

The content which is there in the dt_out it won’t change untill you changed it or modified it.

This variable we can use anywhere…

If possible just debug it and you’ll get to know that variable having data or not in local or immediate panel.

Try this and let me know

Regards,
NaNi

ideally you should be able to get the value…try to debug the flow…use writeline after sequence 1 and before sequence 2 nd see where it is getting changed and also see if you have declared the same variable name multiple times as variable with different scopes or if you have declared as an argument and a variable with the same name.

I am actually not able to get the value of that variable in the sequence2 even if there is no duplicate and the scope is set to flowchart.
In the sequence2 I am using that variable in a different browser is that the issue ?

ok then you may have to debug and see at which point the variable value changes

Print the values in each string before using them.

You probably defined the variable more than once. Don’t do that. Define it in Sequence1 then change the scope to the top level (or whatever level contains all the Sequences).

You can use the search and put in the variable name and it’ll show you if you defined it more than once.

If there is no duplicate and the scope is set properly then you wouldn’t have this problem. So one or the other is an incorrect assumption.