Display rows based on a particular user

Hi team,

My requirement is that
1 . Suppose USER1 has vendors linked V1,V2,V3…V100
2. USER2 Has vendors linked V101 …V150

when USER1 or any of the vendors V1 ,V2…V100 logs in to the app then they must be able to see all Vendors linked to USER1

USER1 & linked vendors should not be able to see USER2 details

How this can be achieved?

If there will never be a USER3 that is linked to V1,V101 then all you need to do is have an extra column on the Vendor sheet that holds the email of the user that is linked to the vendor. However if the first statement is false, and you plan on multiple Users linked to the same vendors then it would be very hard to do what you want.

1 Like

yes… USER3 will not be linked to any of USER1 or 2 vendors… suppose USER1 has email ID xxx@gmail.com… and vendor V1 has email ID 777@gmail.com… then how it cab be related … how vendors can be viewed linked to only USER1

You just need to add a column to the vendor sheet and put the users email, that relates to that specific vendor, in that row. Then make sure to always set the filter rows by signed in user in the Features section of the layouts

It should be pretty straight forward for the user to view their own vendors using per user data as @George_B pointed out as long as the user’s email is on each vendor record.

A few questions I have are:

  1. Do you plan to allow vendors to edit their own data?
  2. Will the user be the only one editing data, or is everything view only?
  3. What will a user or vendor first see when they open the app?

For a vendor to see all other vendors under the parent user, then, assuming you have a vendor email and a user email in each row, I would create a second sheet that is a copy of the first sheet. Name your email columns ‘Email 1’ and ‘Email 2’ on the primary sheet, which will create an array ‘Email’ column. Using per user data (using the virtual ‘Email’ column), the user or vendor will be taken to their own Detail record (This would require the user to also have their own record in addition to vendors. Under there I would create an Inline list and use a relation to link the ‘Email 2’ (User email) column to the ‘Email 2’ (User email) column on the second sheet. This will allow everyone to edit only their own data, but be able to view a list of all related vendors under that user in View Only mode. Now depending on your answers to the questions above, this could change quite a bit, but hopefully this gives you a general idea of how to accomplish this.

1 Like

Hi ,
thanks for your reply…

Both the user & vendor will be able view the data only…Admin ( me) will only be adding the data in Google sheet which will be viewed by both user & vendor …

Is it possible to have a single email address or password for the parent user which will be used by vendor to login…as I don’t want to have a separate vendor email ID?

Hi team
i tried to implement the solution , but i am not able to do it…

Google sheet: https://docs.google.com/spreadsheets/d/17cZbhXMu25wSvuuUoaIUKh5_p5GwOMJmrNia4N30RU8/edit?usp=sharing

App: https://zpvqy.glideapp.io

Eg:

Currently When user logins in with email ID " chethan.m99@gmail.com"

  1. User tab: shows “Accenture”
  2. Vendor Male tab: Shows " VENM0003/4/5/6/9"
  3. VendorFemale tab: Shows " VENF0003/4/5/6/9"

I want to see similar data in all the tabs when any of the vendors logs in
like VENM0003@gmail.com or VENF0004@gmail.com…etc
as all the user & the vendors are linked to a particular user

Please help me on this

I was trying to come up with an idea using 2 email addresses on each vendor record. I got really close, but I ran into a problem with pulling an array of emails into a Lookup column. I posted a feature request, but I’m not sure if or when it will happen.

I think I figured it out though. I created 3 more sheets that will function as tabs in the app. Each of the three tabs builds a single column of emails joined from all three of the existing sheets. This is used to create a per user filtered detail view for each tab. Ultimately I created a relation column that is used to place an inline list in each tab. When the user signs in, they should only see users and vendors that apply to the main user they are attached to. It uses a series of references and lookups to get three columns of emails, then uses an if-then-else column to join the user emails together in one column, then uses that if-then column on a reference to build a list. I hope it makes sense. You should be able to copy the app and take a look at it. Let me know if you have questions.

https://3xgdx.glideapp.io

Thank you very much…it is working as expected

1 Like

With this method for 3 user (U1,U2,U3) & 3 types of vendor like venmotor (VM1,VM2…VM39), venplastic (VP1,VP2,…VP17), venglass (VG1,VG2…VG5) it already took 300 rows but actually I have only 64 rows of data (remaining all due to extra tab with email ID for user and vendor )…is there any other way to solve this problem without increasing the row count too much like this in glide…thanks in advance for all your support and help

I think I came up with a better way. I think no matter what, you still need one sheet that contains all of the emails from all of the other sheets. This, combined with the references, lookups, and if-then columns in the UserTab sheet, is used for per user filtering. Each tab points to the same UserTab sheet. Each tab has a different inline list that uses a different relation from the UserTab sheet. Hope this helps.

https://gfkph.glideapp.io