Hello community, I need you help.
I have problems when searching/counting the number of entries that exist in the bubble AppData based on a field. The idea I had was the following, when a user creates an account, this account is stored in the AppData along with a new field with a randomly generated 8 digit code(using number and letters), in the application I am making, there is a form where the user can enter a code, if the user enters a code that exists in the bubble AppData, then a message would appear below the input field showing that his code is valid, in case the code that the user entered does not exist in the database, then a message would be displayed that the code he has entered is invalid.
Try using Search for User:count is 0 and Search for User:count > 0 using as a constraint that the Referral_Code field (which is the field containing the 8 character digit that is randomly generated when the account is created) is equal to the InputField’ value (which would be the user input) expecting it to count the number of users that have the same referral_code that the user typed, so that when Search for User: count is 0 is true, it would mean that there is no user with that referral_code and therefore it would show the message that the code you have entered is invalid, and when Search for User:count > 0 it means that there is a user with the referral_code that the user typed in, and therefore it would show the message that the code you have entered is valid, but my idea didnt work and i dont know why. I have this in a workflow that is activated whenever, the user changes his input value.
User input field and messages
Hide/Show valid/invalid message based on serach for
This is the User table:
Example of how this doesnt work:
Apparently it only works with the last user created.
I added this alert so that you could see that when I put valid codes, it shows me that the number of users created with that same code is 0.
Please help me :C