Within a For Each, only applying a specific activity once

Unsure if this can be done but I have multiple lines in the Data Table and within my For Each, I need to only apply a specific ‘Click’ Activity on the first pass.
For all subsequent passes I need it to be ignored.

There’s nothing that changes within the application that could make me put in an IF, so if anyone can advise if this can be done that would be much appreciated.

Reason for needing this incidentally, is I’m relying on key presses within the For Each, as the Application doesen’t recognise different cells and so I’m unable to iterate through the Application in a standard way

You can use index property in ‘for each activity’ to get index number and check in ‘if activity’ if the index number is 0, if it is 0 perform ‘click activity’ in ‘then’ block

1 Like
  • Set a variable to the “Index” property of the “For Each”.
  • Place an “If”/“Else If” activity inside the “For Each”.
  • Condition: index=0
    • True → Perform the click.
    • False → Empty.
  • After the “If” perform the rest of the activities.

1 Like

cheers guys, this worked perfectly

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.