I've tried searching but cant figure out the best setup. Any help would be appreciated.
Lets say I have 5 product SKUs. And I have 10 customers. Each customer is assigned specific SKUs. Example, customer 1 is assigned SKUs A and B. Customer 2 only assigned SKU A. Customer 3 assigned all SKUs A to E. An order form would display only their assigned SKUs.
I understand creating tables for customers and table for SKUs. But how would I assign the SKUs to the customer and create an order form that displays those assigned?
Many-to-Many relationships require a junction table. I suggest you create a third table, let's call it customer_sku_assignments. Each record in the new table holds two columns: a customer reference and a sku reference. With this in place, once an order form has a customer value, the list of skus can be constrained to the relevant skus with a formula in the suggested values for your sku enumlist field. It would be something like: SELECT([sku]customer_sku_assignment, [customer] = [_THIS_ROW].[customer]).
Thanks, RedVox. I'm struggling with a couple things. First, when I create a new customer, I dont see the option to assign SKUs to them. I have to do that separately.
As I figure this out, I started with a template from AppSheets demo order app. Here is my demo app. How can I get it when adding a new customer I have the ability to assign products?
There are two ways to do it.
1. Create a child table โProduct SKUโ and reference it to SKU table. Have a column to choose the customer. Add new rows to child table from SKU table. Use โProduct SKUโ table to do this below using a VALID IF select expression.
@Kevinrcup wrote:
An order form would display only their assigned SKUs.
2. Create another column as ENUMLIST base type Ref to Customer table. In the order form validif you can use select() and an IN() with your conditions in table โSKUโ directly.
Both ways you can achieve the results.
Thanks, @Rifad . Both solutions make sense. However, is it possible to have the order form auto display any assigned SKUs and show an input field?
For example, my order form currently has a column for each SKU and after a customer is selected, those columns are displayed based on assignment. The number of SKUs and columns is becoming too much so I'm trying to change my format. However, I can't replicate this "display input field if" order form entry
Before selecting a customer (in this case venue) - no SKUs shown:
after selecting customer - only assigned SKUs shown:
User | Count |
---|---|
17 | |
14 | |
10 | |
7 | |
4 |