I am creating an app where I want to assign a unique (XXXX1111) referral code to each registering user in the letter and number format by using firebase. Can some help in personalising the first 4 letters to be specific so that XXXX never changes but the numbers 1111 changes. Request for assistance.
you can keep a count of registered users in a tag starting from like 1111,
when user successfuly signup call that tag and join it’s value with xxxx
and then in firebase store the new value = got value + 1
The 4 letters Don’t change? But are they useless? 4 letters, should mean some identification. And the 4 digits 9999, should they have 0 on the left? 0001,0002,0099,0199 …
You should use join element to join XXXX & "a random number between (yournumber , yournumber)
and later whenever someone join’s make the value +1…It’s A Bit Confusing… .Hope it works…
I don’t understand non-relational databases. Maybe this:
Create 1 elements to have the sequential number, which will be increased by +1. This sequential number, if 0 is needed on the left, create a procedure that does this.
1-Code field = 1 Take it from the non-Relational database, put it in a variable, add + 1 to this code field in the database.
2-Place the left 0 in the variable.(your procedure)
3- Join the XXXXX-
4- Returns and writes to the database.