My app contains profiles of users. Each user has “friends” who are other users in the app. When you open a user profile, you can see the friends of that user.
I want the app to show users their own friends, just below the other user’s friends. So that no matter which profile I open, I also see my friends list within it.
How do you tag the friends of your users? If you use a sheet Ith 2 columns, first is User ID and the other is Friend ID, you can populate this sheet using a form each time a user add a new friend. And after, use an inline list to display the user’s friends (filter of the inline list = the target user ID)
Hi,
Sure.
Every profile is a row, and every row contains six columns, each for one friend. I did it this way to avoid reaching quickly the 25k rows limitation…
It’s not really a limitation for pro app, but let’s say a “warning” because with more than 25k rows, your app could be impacted by Google sheet performance issues. It depends on your sheet, if it contents some formulas, à lot of formulas or a huuuge number of formula. If your amount of formula is moderated, you could go up to 50k or even 100k rows. But you’re advised it can be less.
You can always store data on a separate sheet and use a combination of VLOOKUP and IMPORTRANGE to call that data to you app. I do this a lot actually. You set a script to nightly move the current day’s data to the sheet and the parts of the app that requires this information is able to pull the data as needed.
I also think @Christophe_HK’s way would be better, so you are limited by the number of friends you can have, but it you want to stick with the 6 column idea, then @George_Lewis1 has a good point with 2 inline lists. The profile list will be easy since you should have an array column created from the 6 columns. You can use to array column to create a relation back to the same profile sheet and use it for the first inline list. For the second list of the signed in user’s friends, create a template column that gets the signed in user’s email from the user profile. Create a single relation that uses the template email column to link back to the profile sheet. Create a lookup column that gets the friends array for the singed in user. Finally create a relation column that uses the lookup friend array column to link to the profile sheet. Use this final relation for the second inline list. It will display the signed in user’s friends on the same page as any other profile they are viewing.
I’m trying to implement your suggestion, but I can’t really follow the logic, and for some reason I can’t make it work.
What do you mean by “create a template column that gets the signed in user’s email from the user profile.” - Should I add this column in the Profiles sheet? Anyway, I did this and followed the next steps, but when trying to perform the last step, I couldn’t create a relation based on the “lookup friends array column”.
I feel like I’m missing here something.
(Just to clarify before I proceed - currently all the profiles data, and the related friends, are managed in the same “Profiles” sheet).