Hi everybody. I ran into a problem:
Each user has their own five-digit code, and when registering, the program asks a new user if he is invited from a friend. If so, he must enter his five-digit code, so that the program will reward the first for inviting the second. Is it possible to find this very code using the action in the button?
Assuming that you have the codes stored in a column in your User Profiles table, use a single relation to match that with the entered code, then you can use a Set Column Values action via that relation to apply the reward.
The code can be found either using a relation column or using a query column like @Darren_Murphy said. However, Glide being a data driven app with no server-side/front coding, you have to think differently when implementing the UI. For ex: Text Field must be connected to column. There is no standalone Text Field that you can use to collect the code from the user, then read its value and use it in a script or query like you would normally do.
Instead try the following approach:
- I assume you are already storing the āInvite Codeā in the User table (or in another table/field)
- Add a column named something like āInvitee Codeā to the User table. This will hold the code that new user may be enter.
- Add relationship column named something like āAccepted Invitesā that matches āInvite Codeā to the āInvitee Codeā. Be sure to check āMatch Multipleā option. This column will show all the matching user rows. You can use this column in other columns either to calculate the number of successful invites or the total rewards.
- On the new user welcome screen use a form with a field connected to the āInvitee Codeā column. When user submits the form, the code will be saved to the user table. The āAccepted Invitesā and any other dependent columns such as successful invites or total rewards will be updated automatically.
If you want to send out email notifications then you can use actions to handle this. Hope this helps.
Thank you very much. Thanks to your comments, I managed to implement it
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.