Trying to build a referral system

Ok. So I have almost everything in place for managing referrals. You can see it on: https://i8tva.glideapp.io/ (Tab: Win iPhone). Or see attached screenshot

It tracks number of referrals and gives the names of people who have mentioned you as a referrer using phone number as a referral id (uses Textjoin Array, in case anyone is interested).

It works. My only problem is that I have to enable Public with email to get this all to work. Ideally, I would want the user to login only when they click on the Tab (or favourite something, but this already works well even in Public apps). Or even more ideally, when the user click the “Create Profile” button after reading everything on the tab.

I tried the suggestion in Login workarounds? of making it public again. However, it doesn’t work for me because I want to customise what I show on the tab based on the login id. That is passed as a parameter when the user fills up the profile form.

Another idea I had was to IMPORTRANGE the data out to another spreadsheet, suitably anonimise it and let people view that to find out the same details. I might then be able to eliminate the login to fill the form.

Any other suggestions on how I can implement this?

1 Like

If you have user profiles set up in your app, then try setting visibility using: if User>Email is signed in user.

If that doesn’t work, create an if then column on the user profile sheet to show true if the email is signed in user. Then create a template with the word ‘true’ and use it for a relation from the win sheet to the user profile sheet. Set your visibility on the components based on if the relation is empty or not.

I don’t claim to have fully understand this, but I get the idea. I implemented this using a formula in the spreadsheet itself. But this is a better way. Also, I wasn’t aware of User Profiles… so thank you.

However, just to clarify, I still have to make the app “Public with email”, correct?

I would have preferred that I keep it Public, and only ask for login when necessary. Glide already does that when someone wants to “favourite” something. All I would like is for that to be extended to any tab that uses the “signed in user” filter as well.

Or implement in some other way that still keeps the app public.

1 Like

A thought for Visibility is to use user profiles like I described, but just check if email is empty or not from the user profile. It should only be filled if the user is signed in, so there is no need to check ‘is signed in user’ when you can simply check if the user profile email is filled.
image
image

Another thought to work around filters is you could probably set up your tabs in detail view, then on the sheet you are using for each tab, add a template column that gets the email from the user profile and uses it to build your relations to the relevant data using email for the relation, so you wouldn’t have to worry about setting filters by signed in user and could keep the app public.

You may have also seen this already as a hack to get around the signed in user issue on public apps, but it’s not the best solution.

However, I think the first 2 solutions may be something that would work better. I haven’t them yet other than a brief test, but it might work and it’s something that I will definitely have to try in one of my apps.

Any of these solutions should keep your app public. The third hack option does work, but I don’t know if it would work forever and any time you would want to add something like a filter that requires signed in user, you would have to change the apps privacy setting each time just to make the change.

Will try them all out. Thanks for all your help!

1 Like

@Jeff_Hager: I was referred to your solution as I just posted what I feel is a bug:

Looking at your solution I don’t know where to start with this because I can find no resemblance to the screenshots you posted.

My use case is simpler than the original poster’s referral system, because in essence all I am seeking to achieve is to show the email field on the forms if the user is not logged it.

Or rather, hide the email field if they are logged in.

I’m amazed this isn’t achievable out of the box with Glide using the same logic as saving to favourites, i.e. force users to sign-up or login in order to use a contact form.

Any clues would be greatly appreciated.

I know the conversation continued in the other thread, but you never responded if you figured it out. I’m not sure what you are not seeing in comparison to my screenshots above, but it you are referring to the ‘User’ values, then those will show when user profiles are enabled. It should be as simple as setting visibility on an email component if the user profile email is not empty. Or you can hide the form button entirely and only show it if the user profile is not empty (signed in)

@Jeff_Hager: I never figured it out, so the form requires an email regardless of whether the user is signed in or not.

I really think any form should force the user to sign up/login before using, this should be core in Glide.

The problem I have, is I have data for over 400 listings and each listing contains an email address, but they are not user profiles as there was no user onboarding as the data was collected from data that is publicly accessible on the internet.

The form I have set up is a simple enquiry form that enables potential guests to send an enquiry to the host, i.e. the email column in the listings.

I think we need to back up a little bit here. Can you explain in detail your ultimate goal and the problem you are having. At least from my understanding, you’ve been talking about a user sending an inquiry to a business listing and it sounds like you want to obtain the email of the person making the inquiry automatically, or through a sign in process, correct? This should be easily doable.

I think you mentioned at one point only showing a manual email entry in the form only when the user is not signed in. I think you’ve also mentioned not showing the form button, or restricting access to the form to only signed in users (both of which should be possible). Yes I would love the option for a form to require sign in (like favorites or comments do) if the email special value is used, but that’s not an option, so I don’t want to dwell on what we can’t do. I want to focus on what we can currently do. First and foremost, have you enabled user profiles and a user profile sheet yet? I’m not talking about the business listings and their emails. I’m talking about the users who actually use the app and at some point sign in. This should allow a user to sign in through the upper left menu and give us easy access to user email anywhere in the app, as well control many aspects of the app based on that user profile.

https://docs.glideapps.com/all/reference/privacy-and-per-user-data/user-profiles

Ultimately, what I envision is 2 buttons. One with a dead link to screen action that says ‘Sign In to Inquire’, and another that’s a form button to continue to the inquiry form. With user profiles, you should be able to then set visibility on each button. The dead link button would only show when the user profile email is empty. The form button would only show when the user profile email is not empty.

1 Like

@Jeff_Hager: Thank you for this, your understanding is spot on!

I have not yet enabled user profiles and a user profile sheet.

The issue is, the business listings are not users, i.e. they do not need to sign in because they are not required to update any info in their listing.

More importantly the other major issue is my app needs to be Public, whereas from what I understand. to use User Profiles my app needs to be: Public with Email, Email Whitelist or be within an Organization.

This is where I am stuck because public with email, email whitelist and organisation are not viable options for my app.

First, like I mentioned earlier, I’m not taking about the business owners, I’m taking strictly about users of the app. Second, where does it say that user profiles only work with ‘public with email’ or ‘whitelist’? Have you tried it on a public app, or tried any of what I mentioned in my previous posts?

@Jeff_Hager: OK, I think I understand the distinction you’re making.

According the following Glide document, user profiles only work with public with email, whitelist and organisations:

https://docs.glideapps.com/all/reference/privacy-and-per-user-data/user-profiles#setting-the-user-profiles-table

Apart from Christophe_HK’s ‘hack’ (which didn’t seem to work), I have not tried any of what you have mentioned yet.

If it’s a no-go, as the Glide doc seems to suggest, then it will not work.

I will have to re-check, but I’m pretty sure that I have enabled user profiles on a public app while testing it. I didn’t get too in-depth in what I could or couldn’t do. You may or may not need to add another tab (something simple, like ‘About’ or ‘Contact Us’) to the menu to get it to show up, but you should get the sign in option.

I’m going to assume the Glide docs are written that way because it doesn’t make sense in many cases to use user profiles without making the user sign in. As @Christophe_HK pointed out, that’s not always the case.

I’d say just try it. It only takes a matter of minutes and if it doesn’t work, we can explore other options.