Reuse code with same variables but with different data

Guys am new to uipath I need help here , pls suggest me I have one sequence with variable contains as “A” . I need to use same sequence in two workflows Bez complete code is same except variable data can I reuse it???
in first workflow variable contains data as “A”
In second workflow code is same variable is same but I want data as “B “ how can I achieve this I mean I need to change the data of variable dynamically apart from everything same

You can Invoke the same workflow many times in between the main workflow @Deepika

Simply drag the workflow wherever you want and pass the different variable values as required

But it’s not working here I have declared default value which I want but it’s not working

Can you explain a bit more , with the screenshots :slight_smile:

I have two pieces of code in first one I need to search for apples so I have created sequence and passed variable “apple” to search in second piece I need to search for grapes so here am reusing the same sequence which I used to search for apples but now how can I change variable apple to grape to search dynamically?

Have you tried passing the arguments to the invoked workflow seperately @Deepika?

You can simply hardcode the variable value also. Create a argument of that workflow of type string and the direction as IN, then Just drag the workflow first time and pass the argument as Apples and again the drag the work flow and pass the input argument as Grapes .

Is no other possibility without hardcore.

This is entire dynamic way of passing variables @Deepika,

I’m asking you to pass the variables according to the need as a argument. If you want to change it on the run , you can use a input dialog box which will ask you to enter the value so that you can enter the required value to it and assign the same to the argument. so that the value you are passing into the workflow is dynamic everytime

Thank you it’s working fine I have passed arg by passing default values

Thats great @Deepika :slight_smile: