Setting up referral program?

Hi there,

I’m really curious to see if there is an easy way to set-up a refferal programme. The idea is that someone earns credits when they sign up as well as the one that sent the refferal (just like Uber/Paypal).

So i thought when signing up someone would use the unique id of the other user. However i can’t seem to get it working:
afbeelding
Isn’t there a simple way to get this working. I’ve seem previous topics but it seems to get complicated with api’s really fast there.

Thanks!

Maybe something like this: using a user’s unique id as a refferal code to sign up. when someone signs up bubble will link that refferral code to an user’s unique ID and send that user a email that once it’s clicked will give the person credits.

You can probably just add the modifier :first item to your search. The action you are using is to change a single thing, but searches return lists.

1 Like

If you’re talking about your red expression:

You want to Do a search for Users. In the search box that pops up you want constraint Users unique ID = Input Referal Code’s value

This will return a list, but it will only have 1 item (if referral code is indeed unique ID), so you’ll need :first item after your search.

Your expression will in the end look like:

Search for Users:first item

(What this will do is return the User data object whose unique ID equals the value in the referral field. IF the referral field’s value IS NOT a unique ID that actually exists, this expression will be empty. So that’s how you can tell if the search failed or not.)

The constraints will only be visible when you click the “Search” part of the expression.

(The way you’re trying to do this currently is incorrect. “Contains” is a list operator. It returns true if the list on the left contains an item of that same type defined on the right.

So what your expression currently does is gets a list of Users and then you’re asking if that list of Users contains an item of type text. This is, of course, impossible, and hence the expression is red.

The Issue Checker, BTW, will tell you this and it is in fact telling you exactly what the problem is. Of course, it can’t propose the correct solution, but FYI.)

2 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.