Enumlist select items based on parent table

Hi all, I have 3 table .

  1. Table Category
    3X_c_2_c2de5a9f77afe2b41501bfed759c73cdec2dc5b0.png

  2. Table Product
    3X_e_c_ec648c8c7cbcefb5d955656630908c335492963b.png

  3. Table Customer, with [Category] and [Product] are enumlist
    3X_5_b_5b4c043534579615d3f14206460ee3e0aeffead7.png

in Customer Form, when I choose the value of Category for Example Fruit and Vegetable (IDC001,IDC002), How could I make the dropdown list of column Product show the products belong to referenced category. In this case will show Apple, Mango, Tomato,Onion options for customer to choose ? Thanks

Solved Solved
0 2 83
1 ACCEPTED SOLUTION

Hello @Phong_Lam, you can use this expression in the valid_if() field of your Product column, it should be an enumlist of base type ref linked to the product table as well:

SELECT(
Product[ID product],
ISNOTBLANK(INTERSECT([_THISROW].[Category],LIST([ID Category])))
)

Let me know if this expression works for you, I havenโ€™t tested it but I am reasonably confident it will work hehe, donโ€™t forget to change the column names to match yours exactly.

The expression should also work if you ever have Items with multiple categories at once.

View solution in original post

2 REPLIES 2

Hello @Phong_Lam, you can use this expression in the valid_if() field of your Product column, it should be an enumlist of base type ref linked to the product table as well:

SELECT(
Product[ID product],
ISNOTBLANK(INTERSECT([_THISROW].[Category],LIST([ID Category])))
)

Let me know if this expression works for you, I havenโ€™t tested it but I am reasonably confident it will work hehe, donโ€™t forget to change the column names to match yours exactly.

The expression should also work if you ever have Items with multiple categories at once.

Itโ€™s working @Rafael_ANEIC-PY , Brilliant , thank you a lot !

Top Labels in this Space