[Sign up] Enter the referral code. Coupon will be issued to referred user

Hi, I have a question. How to issue a coupon to an existing user I referred once the friend signs up with a referral code.

I am having trouble identifying the referred user in the admin panel.

Details are below.
If you can think of an approach that can be implemented in Adalo, I would appreciate your help!
Thank you in advance!

■Signup screen
When a new member registers, he/she saves his/her referral code (a random 3-digit number) in coupon_code (Number type) in the User collection.
=> Your referral code will be displayed on My Page.

If you have received a referral code from a friend, enter your friend’s referral code in the “Referral Code” field (entry is optional) when you sign up for a new membership.
I want to issue a coupon from the administration screen to the user who referred my friend.
Create an Invitations collection to identify the user to whom you want to issue the coupon, together with the new member registration.
The components of the Invitations collection are as follows

code (Number type)
status (True/False)
invite_user (Many Invitations, one User)
invited_user (Many Invitations, one User)

Since the new Invitation is created after the Signup action, the introduced user (=invited_user) can set the Logged in User.
On the other hand, the key introduced user (=invite_user) is not configured properly. I am stuck here.
Here is what kind of user I want to set as invite_user.

Users whose 3-digit referral code input field (also set as Invitation code) matches the User’s coupon_code.

I am not sure how to implement this, since the detailed refinement of the User is not displayed when the Create action is performed.

■Coupon issue screen on the admin page
Display the following in a list.

The name of the user who introduced the coupon
Referred user name
Coupon issue button

When the coupon issue button is pressed, one coupon is given to the referred user.
Specifically, one coupon is added to the coupons (Number type) of the user in question.

If I understand correctly… I would do this.

The click action to connect the inviting user must come from a list of users, filtered by coupon code.
So a button, turned into a custom list.

The problem occurs when you have a duplicate coupon code. Which is entirely possible with a 3 digit code. So I think you need to make the code more complex / unique. Make use of the inviting user ID perhaps.

Hope this helps :+1:

1 Like

Thank you Mr.Rozza!
I will try it after this!
Thank you again!

Hello, Mr.Rozza.
Here is a progress report.

I’m currently working on the following

Prepare coupon_code (Text type) in User collection
Place Randomizer component on the signup screen
Set up an action for the Randomizer component
=>Update Logged in User
=>Set Randomizer > UUID in coupon_code

However, it failed.
To be more specific, when I clicked the new member registration button, the signup itself was completed and a new User was registered, but nothing was set in the coupon_code, which is the most important part of the signup process, and it was empty.

Hello :wave:
I have not made use of the randomizer component. I will have a look a little later and try it out.

My feeling is that you will need to already have the generated code before the signup. Therefore have it as the button that navigates you to the signup screen. Now you can hopefully reference the Random value from your signup form.

1 Like

Thank you!

As far as I can see now, it doesn’t seem possible to do an action on the Randomizer component, for example, to execute it when a button is clicked.

I will continue to investigate.
Thank you for your continued support.

Yes, not possible to perform on a click action. I have tested it and successfully updated a field in the logged in user record with a uuid. So I think it’s possible, you might have to do it in a slightly different order as I mentioned.

1 Like

Thank you very much!

The page before the registration screen of the application I am developing is the welcome page.

I would like to put your advice to use.
Would it be possible to share with me the details you tested?(or process)

Best regards!

I think I would have a link to ‘Get your referral code’
On that screen you have the randomiser component which updates the LIU with the code…only when that field is empty, this way the code can not change if they reload the screen.

In testing you can update the LIU from the randomiser component and display it all on one screen.

1 Like

Thank you!
I followed your advice and implemented the following steps

Prepare a link “Get Referral Code” on My Page
Transition to a screen that displays the referral code when pressed
Place the Randomizer component on that screen
The action of the Randomizer is Update LIU, which sets the UUID when the coupon_code is empty.
Display “Your referral code is 0000” on the screen

スクリーンショット 2023-12-04 19.50.22
Additionally, how do you implement the code being copied when the button is clicked?

Good work.
That is a component from nocode monkey. Available in the market place.


1 Like


I’m also able to implement the granting of one coupon to the relevant user (Current User) in the administration screen!
Thank you again for your help. Thanks to you!

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.