How to Retry if element exists

How to restart the process if element (pop-up window) exists (press ok) and try again.

I have java application where i automatically input data, but sometimes there are errors and i want it to try to re-type the data again. Retry scope is other way around, is there way to reverse that logic that it retrys if element is found? Or is there way to restart the whole process?

This is one more way

Hi! Thanks, i think i did some overthinging for this. Solution is more simple than i tought :wink:
Thanks for giving me the idea.