Breaking out from For Loop

I want to set a Loop to run for N number of times (base on user input). Ff certain condition is True, run action; Else break from the For Loop.

I set the variable number_of_repeats base on user input. Say, variable_number_of_repeats = 10.
My loop counter is loop_counter. This is variable is auto populated when the For Loop runs.

For Else, condition, I assign the loop_counter to the max, 9 (loop_counter runs from 0 to 9), hoping that the For Loop has reached the max iteration and it will stop.

But it didn't. How can I fix this?

you would need to use the predefined action "Cancel For Loop" in your else branch.

Thanks. "Cancel For Loop" works perfectly.