Manipulate several table records at the same time

Hello,

I want to change the value of a specific field to all the records in a table that comply with a certain condition. Let me explain my case:

I have a table with production orders, where each record represents and individual order. Each record has some fields that define the attributes of the order: id, nfc id, variant, quantity, status.

The status defines the current location of the product within the process, for example: queue, station 1, finished, among others. When I cancel or complete my App, I may have unfinished orders (perhaps they are in queue or in other stations). I want to change the status of all those unfinished orders so I can have a log in my table and be able to know which orders were not completed.

My idea goes as follows: I created a query to filter the orders whose status is not equal to “finished” and then changing the status of all the records that satisfy this condition. This should be accomplished using the complete App and/or cancel App triggers. Indeed, for one order it would pretty easy to do using the table records > data manipulation actions. However, my problem comes when I want to do it in bulks because Tulip does not include for loops natively.

Here’s an overview of my table:

And this is how I am defining the trigger:

PS: I have already loaded the table into that respective App, with the necessary query to filter unfinished orders.

Thank you in advance for your support.

Orlando Manrique