rows().every with delay between each row?

rows().every with delay between each row?

BluestoneBluestone Posts: 9Questions: 3Answers: 0

I'm using rows().every to run some code for every row found. My issue here is that it's running the code as many times as the found rows, but on the instant.
How can I run the code once when the first row is found, wait, then run the code again when the second is found, wait, etc etc.

I've already tried setTimeout() but it still runs the code instantly as many times as the found rows.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin
    Answer ✓

    You'd need to read the row indexes into an array and then execute your own loop, with the setTimeout being run at the end of each interaction before then moving on to the next.

    There is no option to use a setTimeout with the built in method.

    Allan

  • BluestoneBluestone Posts: 9Questions: 3Answers: 0

    Good thinking, got it working perfectly. Thanks.

This discussion has been closed.