Choice Component! how to populate based on previous Selection

Hi! need help

In a custom add form “order” i get product from “product table” using choice component.

Instead of write the quantity in the “order” i want a second choice component, there are only 3 quantity options based on the product from first choice.

Each Product has diferent quantity for each of the 3 options

I do not know how to populate the second choice with this 3 values

3 values for each product but 4 identical groups of quantities

I can filter the second choice based on the name of the first one, would be much better to get that from Product table

Product 1 1kg 3kg 5kg
Product 2 10Kg 20 kg 30 kg

regards

Use Screen Values to filter your Choice Components.

Hi Darren

Thanks! Screen Values works Perfect!

My big issue is to populate this filtered choice component, i can get one value from quantity column in the products table and write to the orders table

I need 3 quantities values associated to each product, showing in the choice, i do not know where to place then. It is 4 groups in total of 3 equal values for each product

Product 1
A B C ==> choices would solve with this 3 values in one column of the product table

Have you tried enabling multi-select on the Choice component?

This will give you a comma separated list in the target column. You can related that to other tables by first converting it to an array with a split text column, and then use the split text in a relation.

Darren,

I did no get that

do i need a helper table?

I am sourcing the Choice with column quantity fine woriking with only one option

Product Table:
Product quantity
Product 1 100 would be text not number is enouch => working

Product 1 100, 300, 400 only 3 options in the choice

Did not find the way to convert CSV or array or Split to columns

Maybe I misunderstood. Can you show me a screen shot of the Data Table you are using for your choice options?

Hi Darren,

This is not the app but shows what i need

Source product and quantity

It Shows only one option in the choice componente i need 3

So how to get 3 values from Products table

Regards,

Where do you expect to get a list of all choice options for a particular product? I only see one quantity option listed per product in your product table. I don’t see any other table that would list out all of the quantity options. I think you need a seperate table just to list out all quantity options per product or per type of product, but I want to make sure I’m not missing something.

Hi Jeff,

Consider each product has 3 packages, in my table only one, i do not know where to put then

Afther choose the product, the second choice component is showing the only package i have in the product table

I would like to see 3 options ro choose one to write in the order table

Regards

Ok. Would the choices be the same for certain types of products or would they be different for each type of product. What I would suggest is a separate table that has one column with either the product ID or the type of product. Then have a second column with a the value you would use for your choice. Then create a row for each possible product/choice combination.

The choice component relies on each choice item being in a separate row.

Hi Jeff

500 products, each product has 3 packages and only 4 groups

Product / Package
P1 / A B C
P2 / A B C

P3 / A D G

P4 / H Y U

P500 / G H K

In the order form, choice one get product then choice two only one of the 3 packages related to that product

Maybe i need many tables

Regards

It can all be one table. You don’t want multiple tables to deal with this.

I mentioned product types previously. Looking at P1 and P2, they both have the same choice options, so I’m imagining that they would belong in the same type or category. Could their be a type or category to group multiple products together and they can share the same choices? Or would a lot of products not share the same choice options?

There’s also another approach which would save on rows. You could still have a separate choice table with two columns. One column would contain every possible choice only listed onceper row. The next column would contain a comma delimited list of all possible product IDs that could use that choice. Then it would just be a matter of pointing the choice component to that table and filter the choices where the comma delimited list of product IDs is included in the product id screen value of the chosen product.

1 Like

Jeff

all 500 Products has one of the only 4 groups (category) of choices, after choice one get the product the Category is defined

Table Products
Product Category
p1 Category1

Table Category
Category1 p1 p2 p3 …
Category2 p5 p6 p7 …

Table Categry with packaging
Category1 Category2
A D
B E
C F

So the secong choice would be populated from correspond category i do not know how to do that

this what you were thinking, the category makes a lot of sense

Ok, so here is how I would do it.

  • Create a new Choice table.
  • Add a column for Categories and another column for Quantities
  • Fill the table with with each category and and quantity combination that is possible. If you have 4 categories and 3 quantities for each, that should be 12 rows.
  • Add a relation column that links the category column to the category in the products table.
  • Add a Lookup column that uses the relation to return an array of matching products for each category.
  • Add choice component to your form and set it’s source to the. choice table.
  • Add a filter to the choice component where the Lookup column Contains the Screen Value of the selected product in the previous choice component.
2 Likes

Hi Jeff

You are great, i lost many many hours, put to work with an aditional step very bad

You did it perfect! So everything is working now

many thanks

regards

1 Like