I made a referral system. The user registers, then a window appears where he can enter the code of another user. After entering, the code is saved, and the new user goes to the products where he can view them, and the user whose unique code he entered will receive a discount depending on the number of people that he brought.
The problem is that when a new user enters a referral code and then clicks on a button, which causes a small “Action”. And there in this “Action” I have a check that the entered code must belong to someone.
I have in the table a column with all users taken using “Query” and a column with “Joined List”, where all the keys taken from the column with “Query” are located, and in “Action” I set the condition that the code entered by a new user must “is included in” to the column with “Joined List”, and so, the user enters the code and it works, saves the code of the new user and gives another a discount.
But the problem is that even if the user enters half of the full referral code, the Glide check will count that it is correct, which means it can also be written down, but the discount will not be given to the person who gave this referral code, but as luck would have it, whose unique number was closer to this code. In general, the problem is with “Joined List” and “is included in” and what could be done here?