One to many relation & filtering it on a map

Hey Glide Community

I have a quick question. I am doing a one to many relation & I got it to work but not entirely correct. I have things set up as a tiered membership (1, 2 & 3). The gyms are tiered 1-3 on their pricepoint & the users are tiered 1-3 on their membership they purchased. I am able to match them to the right tier, but when I match them it doesn’t include the tiers below.

How would you recommend matching that level & include the ones below??

Then once I have that, I need to filter it by email so that it the user only see’s their membership level & below. How you filter the data? I have a map as the homepage so would there be a way to fliter by email? Would really appreciate your help!

How about setting up three Tier columns on your user sheet (‘Tier 1’, ‘Tier 2’, ‘Tier 3’). You could put in the Tier number in each column. Then you can set up a relation between the user (using the virtual array ‘Tier’ column Glide creates) and the tier in the gym sheet. I assume you would show the users details by default and using the relation you can add an inline list that displays all of the related gyms that the user can see.

As for how you fill the tier columns in you sheet, that’s up to you. I suppose it could be a form or a set of if then formulas, but I’m sure there are several ways to accomplish that.

The 3 tier column would work but that doesn’t account for the lower tiers in the high tiers. ex. if you had a 3 you wouldn’t have access to 1 & 2. I basically have that now just in one column. I agree inline list is probs the best way to filter it. Just as i was typing this out I though about having a true false section for each in a 3 column section, but i’m still not sure how i would filter that. it seems binary responses are easier to work with though.

Why don’t you use a filter, using only one column, such as : item tier <= user tier? If a user is 3, it would see all items from tier 1 to tier 3.

Hey Chris - would you mind providing an example (screenshot of sheet)? I’m not familiar with how that would work/look like.

I appreciate your help!!

What I was thinking is that for each user you fill the tier columns with only the tiers that they have access to. If the user is a tier 3 only, you would put a 3 only in the third column. The other 2 columns would be left blank. The relation would only link the 3 to all tier 3 gyms. If the user is a tier 2, then you fill column 2 with a 2 and column 3 with a 3. The relation would find all tier 2 and tier 3 gyms for that user. It works because you would use the virtual Tier array column that Glide creates. It allows you to link multiple columns in one sheet to one column in another sheet.

ohhh i see what you’re saying! I will try it out & let you know how it goes

1 Like

Coudn’t get it to go through… This will definitely work though because i will be able to filter by the emails in the column. I tried filtering by the single column which you can see in the screens under membership, as well as the 3 columns like I did on the gym side but neither worked. any ideas?

here are a couple screenshots:

Just curious, is the first column in your sheet filled with empty values? I’m wondering if the relation is working. I think relations will usually just show the first column of a sheet, even though it’s linked to the entire row. If that’s not the case, then maybe I would try values other than numbers. I’m wondering if the numbers are making things weird. From what I’m seeing, the relation should work.

Also, I was picturing the Levels column on the users sheet instead of the gym sheet. Basically the opposite of what you have now. I was only thinking that because I’m assuming the user would be taken to their user record when opening the app, and the relation to the gym sheet would present to them the gyms that they have access to.

Just taking what you already have though, are you able to set up an inline list in the gym details that shows all of the related users?

No - it’s filled with emails. Yeah in my experience it has so i switched it from the names in the first to the email. I know right? I PM’d you the spreadsheet if you want to take a look - I could share the app with you too (not sure how to do that though haha).

The reason i did it this way is that I can’t filter by the other sheet. this sheet is where i have the main map page & so i would be able to filter by signed in user (i think) from the relational column like we have there.

no - but that’s not what im shooting for, just what the main page to be filtered by signed in user, but i need the relational column to be working to test it out.

1 Like

I’m about to call it a night, so I’ll try to take a look at your sheet tomorrow.

1 Like

let me know when you have some time today i’ll share the app with you so you can take a look at the insides

I took a look at your sheet and converted all the 1, 2, 3’s to A, B, C’s on the gym and user sheets. That allowed the relation to work. I think it was comparing numbers to strings, so a match wasn’t being found. If you can convert you tier levels to something like ‘Level1’, ‘Level2’ and ‘Level3’, I thing you should be fine. Then you can create a lookup column to get the users email and use the lookup column to filter the gyms by email.

2 Likes

so beautiful - it works!! haha thank you so much for your help!! I owe you big time!!!

2 Likes