Allocate a user to next empty item

I have a list of coupon codes and when a new user joins I want to allocate them the next code that’s unassigned…what’s the best way to do this?

Hi there, @LA81638… I don’t know what it means for a coupon code to be assigned in your app, but in theory, you could simply do a search for the first coupon code that’s unassigned, and assign that code to the new user.

The above being said (and I’m guessing you know this already), you will likely want to handle the situation where multiple users sign up at the “same” time, and that’s where the concept in this post/thread should be useful.

Hope this helps.

Best…
Mike

thanks mike, so first item that ‘user’ is empty…make sense, thank you! Will check out the other thread

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.