Support Portal

for ProcessRobot and WinAutomation

Start a new topic
Answered

How to select from list randomly?

Hello,


I would like to know how to select a value stored in list randomly (a list inside the application, not web list)


Best Answer

Hello Jeff.


There are two ways to select a value randomly from a list:


1) You can shuffle the list, using the "Shuffle list" Action (which creates a random re-arrange of the list) and grub an item (e.g. the first item of the list)


2) You can use the "Generate random number" Action (within the index range of the list) and use this number as an index for the list, so as to grub the item within the list (e.g. List_Item = List[Index])  )


I hope that the above is helpful!


Keep on automating :) 

1 Comment

ADMIN
Answer

Hello Jeff.


There are two ways to select a value randomly from a list:


1) You can shuffle the list, using the "Shuffle list" Action (which creates a random re-arrange of the list) and grub an item (e.g. the first item of the list)


2) You can use the "Generate random number" Action (within the index range of the list) and use this number as an index for the list, so as to grub the item within the list (e.g. List_Item = List[Index])  )


I hope that the above is helpful!


Keep on automating :) 

Login or Signup to post a comment