Copy all and only the rows that match

Hi!

I am having trouble with the "execute an action on a set of rows" action.

I need all rows from the "Items" table that have in the "Category" column the same values (one or more) that were selected in the category field (EnumList type) to be copied to the "Inspections" table.

Could someone please help me out?

I have the following tables.

image (1).pngGiven that the user has selected categories "Category X" and "Category Y", this would be the expected result.

image.png

Ps: I need to copy only the values of the Product and Category columns from the Items table.

 

Solved Solved
0 2 88
1 ACCEPTED SOLUTION


@laylacomparin wrote:

I am having trouble with the "execute an action on a set of rows" action.


What trouble specifically? If the trouble is reliably identifying the rows to be copied, try an expression like:

SELECT(Items[Item ID], IN([Category], [{the category field (EnumList type) where the user selected the categories of products to copy}]))

Depending on exactly what you need to do and where (i.e., which table) you need to do it from, consider whether the Data: add a new row to another table by using values from this row action might be a better fit.


@laylacomparin wrote:

Ps: I need to copy only the values of the Product and Category columns from the Items table.


Consider whether you're best off copying just the Item ID and Category ID columns. From there, you can dereference to the Product, Category, and any other values.

View solution in original post

2 REPLIES 2


@laylacomparin wrote:

I am having trouble with the "execute an action on a set of rows" action.


What trouble specifically? If the trouble is reliably identifying the rows to be copied, try an expression like:

SELECT(Items[Item ID], IN([Category], [{the category field (EnumList type) where the user selected the categories of products to copy}]))

Depending on exactly what you need to do and where (i.e., which table) you need to do it from, consider whether the Data: add a new row to another table by using values from this row action might be a better fit.


@laylacomparin wrote:

Ps: I need to copy only the values of the Product and Category columns from the Items table.


Consider whether you're best off copying just the Item ID and Category ID columns. From there, you can dereference to the Product, Category, and any other values.

It worked perfectly! ๐Ÿ˜ƒ
Thanks!

I'll consider your suggestion to do it using the action "add a new row to another table by using values from this row".

Top Labels in this Space