How to loop through selectors with for-each? Is it possible

I am very new to RPA and UIPath. I have a couple of checkbox’s that I would like to loop through to check to make sure they are appropriately checked. Can I easily do that through a for-each within UIPath, or is there a more efficient way to do this?

Hello, @gary.vaughn could you share an Screenshot of the Checkbox’s, I would like to help you but I need more details

Hi @gary.vaughn

Yes you can do that with for each
Steps to be followed:

  1. Datascrap the values
  2. go to the variable panel and create a variable “Counter” and make default value as 0
  3. For each row in “Datascrapped” variable
  4. Use click or check activity on the 2nd checkbox {after selecting the Selector go to UI Explorer and check if “idx” attribute is there if there just choose the variable(i.e., if idx=2 is in the attribute just select on the 2 and right click and choose variable and select on counter after choosing it will be like idx=’{{Counter}}’)
    If idx is not there just paste the screen shot here will help you
  5. After creating all the process you have to increment the counter like
    (Assign Counter = Counter +1)
1 Like

Hi @gary.vaughn ,

You can also use FindElement activity to get all elements of checkbox and then you can iterate it in foreach loop.