Ability to set unique entities in the database
Bobby G
Any chance that anyone has figured out how to have two unique fields when creating an account? I'd love to have a unique username AND Email.
Thanks!
Glenn McWhinney
I'd like an auto-increment number field starting at a developer specified starting number (e.g. 1000) for use in situations like Orders and an Order Reference, for example.
J
Jeffrey Michael
Glenn McWhinney: Hi Glenn, have you found a solution for this? I’m also trying to create unique order id on an action. Hoping to use for Zapier Webhook.
Glenn McWhinney
Jeffrey Michael: Hey there. Nope! I used the random function in the end so I have Order Refs like: SO-1432432 and SO-9865435.
J
Jeffrey Michael
Glenn McWhinney: nice! This should work for me. Can the same random number be shared between 2 collection? Ex: Order and Items in Order ?
Glenn McWhinney
Jeffrey Michael: Yes I don't see why not! You would need to set it in the Orders collection first then access it via Current Order when creating the Order Items. Something like that
AJ
Glenn McWhinney: This is great for what I need but how do you ensure the number is unique?
Glenn McWhinney
AJ: Well, there is a chance that the same number gets picked twice but there's a 1 in 9 million chance of that happening in this example so the odds are in your favour :)
AJ
Glenn McWhinney: Thanks Glenn I will roll with this for now
Darragh
There are two similar/related threads to this: