Hi @edward
This may work for you.
Instead of putting that ‘Calculate RandomString:converted to number’ straight into your Code field, as seen in your image above. Put the calculated 4 digit code into a custom state before hand. Once you have that, you can then do a search for the custom state value and only use it if it’s not already found.
Like this…
Only problem is that if the chances of a randomly generated 4 digit code has been generated and used before, then you’ll have to handle that.
In the formatted text part, value for Yes is just Index code, value for No I left blank. It might be good enough for what you need or there might be a better solution to handle this but hopefully this may get you thinking into other ways to tackle it. 
1 Like