Dynamic Row Owners - Possible?

Scenario: App service for store owners to create e-coupons

Types of users:
Store Owners
Consumers

Overview

  • Each store owner can create “coupons”
  • Each coupon has a “coupon code” associated with it and in order for the consumer to be able to redeem the coupon they must simply log into the app and then enter a valid coupon code
  • Upon putting in a valid coupon code they will then see the coupon redemption details
  • I don’t want anyone sniffing the data and seeing all possible coupons - only the ones they have entered codes for
  • I want store owners to only see their coupon codes, stats on viewed, and who redeemed them
  • I do not want this to be a “private app” using roles - just normal pro level

I know this has to do with Row owners and want to avoid filtering scheme, but not sure how to pull this off.

Here is what I am thinking for the table structure

  • users - email column as row owner, role column (controlled externally) to indicate they are store owner or consumer
  • coupons - owner column as row owner for “store owner user”
  • coupon stats - owner column as row owner for “store owner user”
  • coupon redemption details - owner column as row owner for “store owner user”, need a way for dynamic consumers also be able to see this
  • consumer redemptions - row owner column as the consumer, column to indicate valid (invalid ones get cleaned up, or user is blocked after so many attempts to prevent abuse)

How do I protect the list of valid codes?
How do check if a consumer enters valid code?
How do I protect the redemption details rows by only allowing consumers who have provided the correct code to be able to see the details?
How do I get the store owner to see who has redeemed the codes?

Thanks in advance - this community is awesome at sharing ideas.

To check if a consumer enters a valid code, you would have to get those rows into their device first to make a relation from the input column to the list of codes. Hence I don’t believe using row owners on those rows is a good idea.

If you still want to use row owners, it’s a bit of a long con but possibly trigger a webhook on the submission of a code, get that to Integromat, search for rows inside the Sheet and return the result to the Sheet if there’s a matching code.

You will have a column of emails who have redeemed the code in the coupons sheet and if you find a matching code via the step above, update that list of emails with the new user.

Then the owner can see who has redeemed the code, add the list of emails as another row owner to let them see the details.

1 Like