Add all rows of this table with status column = xxx, to another table, with a single action

Hi. I'm trying to send all rows of an 'order' whos status is 'xxx', to the 'invoice' table with a single action. I can get this to function with selecting each row then performing an action but I want it to work with a single click. I don't want to have to select rows in a table view individually when there is data that can select the rows.

Solved Solved
0 6 531
1 ACCEPTED SOLUTION

Aurelien
Google Developer Expert
Google Developer Expert

my filter is

FILTER("Order Line item", OR([Status]="Invoice", [Status]="Back Order", [Status]="Sample"))

So it only put rows with the status "invoice" into the invoice table yet i want any of those 3 status's to go.


Are you sure about the syntax of "Back Order" and "Sample" in your table ? If you try the "test" feature of the expression fied, do you get the expected result ?

Aurelien_0-1662959134703.png


Also it put rows applicable to all customers rather than just for the customer whos page the button is on. I tried to filter for THIS customer but dont know how to combine it all into one expression

What about this:

FILTER("Order Line item", 
  AND(
      [_THISROW].[customer]=[customer], 
      OR(
         [Status]="Invoice", 
         [Status]="Back Order", 
         [Status]="Sample"
      )
   )
)

where:
[_THISROW].[customer] is the customer from the table in which the FILTER() expression is evaluated
=[customer] is the customer from the table "Order Line item"

 For reference:

FILTER() - AppSheet Help

 

View solution in original post

6 REPLIES 6

Aurelien
Google Developer Expert
Google Developer Expert

Hi @MAAK 

What about this action ?

Aurelien_0-1662563690144.png

You would replace "Tasks" here by "Order", and the FILTER expression with:

FILTER("Order",
  [Status]="xxx"
)

For reference:

FILTER() - AppSheet Help

Use bulk actions - AppSheet Help

 

 

You can use this one:

 

Thanks for the answer.

So it appears this may filter out the correct rows.....then can I use another action on all those resulting rows at once? The action 'Data: add a new row to another table from values from this row' only works on one row? 

What action can do the same on multiple rows?

Aurelien
Google Developer Expert
Google Developer Expert

"then can I use another action on all those resulting rows at once?"

Correct.

"The action 'Data: add a new row to another table from values from this row' only works on one row?"

Correct, unless you call it with the previous action "execute an action on a set of rows". It will be triggered for each row that will be in the output of the FILTER() expression.

Hi.. Well cool,, partial success
my filter is :

FILTER("Order Line item", OR([Status]="Invoice", [Status]="Back Order", [Status]="Sample"))

So it only put rows with the status "invoice" into the invoice table yet i want any of those 3 status's to go.

Also it put rows applicable to all customers rather than just for the customer whos page the button is on. I tried to filter for THIS customer but dont know how to combine it all into one expression

Aurelien
Google Developer Expert
Google Developer Expert

my filter is

FILTER("Order Line item", OR([Status]="Invoice", [Status]="Back Order", [Status]="Sample"))

So it only put rows with the status "invoice" into the invoice table yet i want any of those 3 status's to go.


Are you sure about the syntax of "Back Order" and "Sample" in your table ? If you try the "test" feature of the expression fied, do you get the expected result ?

Aurelien_0-1662959134703.png


Also it put rows applicable to all customers rather than just for the customer whos page the button is on. I tried to filter for THIS customer but dont know how to combine it all into one expression

What about this:

FILTER("Order Line item", 
  AND(
      [_THISROW].[customer]=[customer], 
      OR(
         [Status]="Invoice", 
         [Status]="Back Order", 
         [Status]="Sample"
      )
   )
)

where:
[_THISROW].[customer] is the customer from the table in which the FILTER() expression is evaluated
=[customer] is the customer from the table "Order Line item"

 For reference:

FILTER() - AppSheet Help

 

Hi Thankyou

The above works for status but not for the customer filtering. I was getting the error: Cannot field the column "Customer" in [_THISROW].[Customer]

So I changed the expression to:

 

FILTER("Order Line item",
	AND(
		[_THISROW].[Customer ID]=[Customer],
  
		OR (
			[Status]="Picked", 
			[Status]="Sample Picked", 
			[Status]="To Do"
		)
	)
)

 

And this works filtering the customer (yes I altered the Status Enum values).

The column "Customer ID" is in the "Customers" table so the correct "Order Line item" rows are being put into the "Invoice line item" table.

Thankyou SO Much Aurelien for your help.

Lol now next hurdle... creating the parent "Invoice" table
I think i need to learn how expressions work rather than my trial and error apoach

Top Labels in this Space