Will a validate step within a repeat, stop further repeats/loops?

Hi all,

Quick question.

I have a repeat, and this repeat inserts data into the DB. I want to avoid a duplicate. Normally I’d do a lookup on that record within the repeat and then use a condition but I feel validate would be faster.

In this example:

Repeat will loop 5 times. Each time if validate step does NOT find a match, it inserts records in DB.
Validate Step finds a DUPLICATE in the first loop.
Will the repeat continue for then ext 4 times, or due to validate will it stop all remaining loops?

I believe it will continue, as that’s the nature/purpose of a repeat, but want to double check.

Thanks.

hmm, Wappler team can you correct me on this - but from testing it does indeed appear to stop any further actions, even the next loop/repeat?

The validate step, when validation event occurs, will stop the server action.
If you want to check if the records exist in the database, run a db query, check if it returns a value or not and use a condition after that.

Thanks Teo, this is what I currently do - just thought the validate might be another way to tackle it, faster. All good - thanks for the clarification.