Repeat activity and constructs

activities
variable

#1

Hello everyone. I am new in UiPath. I have few questions. So, which activity can repeat activities within specified time range, and what type of constructs should i use to store undefined number of variables in the memory of the same type. I have watched and read all information that UiPath gives but can not find some.Please write something or just share useful links. Thank you.


#2

I can think of below ways

  1. Replay event
  2. retry scope
  3. using a while loop

#3

To add to what @vvaidya posted,

If you can detect how much time is passed then you can exit a loop after a time period. You can do this by storing current time before the loop, then assign current time during the loop and compare both values to a System.Timespan variable/value (i.e. 00:05:00 for 5 mins).

For example,
nowTime = Now
Do
Assign looptime = Now
While (looptime - nowtime < timespan)

or with a Retry Scope you can set how many Retries instead pretty easily in the parameters, but is used mostly for Exception catches. For example, if you have an unstable website portal to log in to, you can Retry multiple times if the site fails on you.

To use a condition in Retry Scope do a search for “Expressions” or “Is” and use one of those, mainly “Is True”. You can use similar logic as a Do While with it if desired.

Thanks.


#4

You could use stopwatch (System.Diognostics) instead.

https://www.dotnetperls.com/stopwatch


#6

Thank you! Can you please help me the second question - what type of constructs should use to store undefined number of variables in the memory of the same type.


#7

You can store the variables in a List which has dynamic memory allocation.

Or a dictionary


#8

Thank you very much!