Hi,
I built a social network app. Each user has “friends” (which are other profiles). I want to calculate mutual friends, or at least to note if two users have mutual friends at all.
Is there a way to compare two relations?
Thanks!
Hi,
I built a social network app. Each user has “friends” (which are other profiles). I want to calculate mutual friends, or at least to note if two users have mutual friends at all.
Is there a way to compare two relations?
Thanks!
Was sort of thinking about comparing matching items between 2 different relations via another relation but I don’t think it’s currently possible.
I know it would take you out of glide, but this could easily be done in sheets. If a solution in glide cannot be found.
Although there may be a small delay this is not something that the user is actively using and waiting for immediate results. I cannot imagine any lag introduced by doing this in sheets would affect the user experience.
Thanks, will consider it.
Perhaps @Jeff_Hager has a creative hack within glide ?
How is your data structured?
I have a profiles sheet (I think rather a standard one).
Another sheet holds the friendship records. One column for User’s email, another column for Friend’s email (this sheet is filled with a form).
Then I do a relation from the friends sheet to the profile sheet, to bring together all the friends per user…
Ok. So if I have 10 friends my email shows up in 10 rows, then your email in the next 10 rows if you had 10 friends for example?
Yep, for example. Of course order of rows could mix as people add friends on various times, but I think you got the idea
I do not see how this could be done in glide. I have done it in sheets though. Pretty simple.
One thing I realized in creating the demo, you will need to add the inverse friend relation after someone adds a friend (either automatically or have the other user “approve” it and then have it added upon approval.
Without this the issue cannot be solved as the reference column is ill defined. AKA you need a column that is the match column for names and the next column has the friends.
So if Bill decides to be friends with Jim, two records need to be entered Bill | Jim and Jim | Bill, unless ofc your friendships are unidirectional.
Let me know if you are interested in the sheets solution.
I’m going to assume that you friendship sheet is always set up so the first column is the user profile, and the second column is the friend of that user.
Thanks! I’ll try to implement Jef’s solution first, and will let you know
Brilliant!
Thanks a lot.
I think I’m just stuck with the last “if-then” phase.
The friends records are in a dedicated sheet, and every user can appear multiple times (every time he adds a friend, another record is created).
Using your logic, I succeeded bringing to the profiles sheet a relation with all the profiles (or emails) with whom each user share mutual friends.
But I don’t succeed in marking, per user, if I share a friend with him or not…
Could you share a couple screenshots that show how you ended up setting up the friendship sheet and and how you created the relation in the profile sheet?
Ok sorry, it’s working now. Thank you so much.
@Mark you should hire this guy (if you haven’t already)
Hehe, they wouldn’t be able to afford me.
Na nobody can
ecspecially because of your quick brain