Filtering user-specific data in multi-vendor system

Hi there, I’m building a Customers table for multi-vendor platform. Admin users should be able to view all customers who have ever bought on the platform. However, each vendor should only see the customers who have ever bought an item from the vendor.

I tried setting up a row owners column on the underlying Google Sheet of Customers by defining these columns: Owner 1 (“Admin”), Owner 2 (“Staff”), Owner 3 (“Vendor”). The problem is that the resulting “Owner” array column on Glide allows any vendor to view all customers. Ideally, each vendor should see only the customers they have transacted with. How would you achieve this?

Here are the relevant portions of Customers, Vendors and Orders tables:



Your row owners need to be a little more specific. Instead of granting access to all vendors, you should only be granting access to specific vendors. This gets quite complicated though if a customer can be associated with multiple vendors. Your array would have to have as many columns as the maximum number of possible vendors that the customer could ever be associated with. Honestly, I think you are going to have trouble setting up a scenario like this.

1 Like

Indeed, it’s already troublesome for me thinking about it :sweat_smile:

I have considered creating some kind of association/relational table, with two primary columns: Vendor Email Address and Customer Row ID. I’d then have an action that writes an entry to this table every time an order is generated.

My problem is how to keep the Vendor <> Customer entries unique so that my layout component (Collection) doesn’t pull up duplicates…

Vendor-1, Vendor-2, Vendor-3

Customer-A, Customer-B, Customer-C

Hmm, not sure I understand what you mean here @Eric_Penn:thinking:

If you template something unique to the end of your roles then essentially everyone has their own role. Then you can use inclusive conditions for visibility, editing, etc… if users role → includes → Vendor

You are still going to run into the issue that @Jeff_Hager brought up. You will need as many columns as the maximum amount of connections possible between vendors and customers

Oh so your proposed solution is basically similar to the one @Jeff_Hager raised. I was confused because I thought you were responding to the idea of a relational table

Indeed it’s the same.

It could solve this part.

None of the suggested solutions above worked: it’s not so feasible to have role columns Role {1…N} when the value of N is not known ahead of time. Also, the initial idea I had to create a separate relational table didn’t make sense as I’d end up duplicating much of my existing Orders and Customers tables.

Instead, I decided to maintain separate customer profiles for each vendor, even if it means that some or all the data fields on each customer profile might be duplicated between vendors.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.