At the end of a loop is it possible to continue to next routine if one key is pressed and loop again if another is pressed

Hello, i am using most recent psychopy version and running it on macOS using the builder.

I am trying to set a loop to end if y is pressed or loop back to start the loop again if n is pressed. However i am unable to figure this out using the builder.

Below is a screen shot of the structure, so the first routine loops round 4 times then the second routine will ask if continue y or n, if y it moves on to next routine, if n it goes back and runs the first routine again…this keeps going until participant uses y and can progress.

is it possible to trigger this using a form maybe?

Any help will be greatly appreciated.

If anyone knows how to do this using the pavlovia JS i will be syncing the experiment into pavlovia once i have this element figured out. Is it even possible?

Thanks