Create static integer count in uipath

Hi everyone , My ques is : If i want to create one static integer counter & assigning some value to it ,after running entire flow the value of that integer will increase .
Hence i need to store that value for next run of process . How can i store that ?

Eg : integer Num1 = 0 ;
after Num1 ++ ;
Num1 =2

In Next run of this job ,I wan Num1=2

Hi @piya_tambe_patil

Welcome to community,

If you want to store the value for the next run and use the value , you can store it in orchestrator asset and use “Set Asset” value to set the asset value and use for next run.

Please have a look,

Change value of an asset integer - Help - UiPath Community Forum

Thanks

1 Like

Hi @piya_tambe_patil

Did you try this method.

Thanks

hELLO @piya_tambe_patil

you can put the code inside a while loop. Initialize a variable “i” as 1

while i< 20. (20 is the maximum value for the counter, you can change as per your need)
{ add all the processing activities here

use assign activity i=i+1

}

So loop will work for 20 times and values of i will increment by 1 and you can use it.

Hi @piya_tambe_patil,

You can keep the data in database or excel. It can stay in the excel directory. This way you can keep the values ​​up to date for the next run.

You can keep the value in the asset, update this value every time the process runs, and prepare it for the next work.

You add this data as output to the items you add to the queue in your first process. The other process’s queue is the data that this process runs. In this way, you can get the data you added with output.

Regards,
MY

Use default values available in variable pane