Looping with Action

NCD
Silver 2
Silver 2

@MultiTech 

Hi, I've been using your Looping with Action method, and it's working great.

Thank you very much for your AppSheet Knowledge!

 

I was wondering if there are any way to reverse the action, what I mean by it is once you've selected a product by enumlist, it automatically creates the child and grandchild, but if I accidentally checked a product, I would like it to delete once I uncheck that one from the enumlist. 

Is this possible?

Solved Solved
0 6 493
1 ACCEPTED SOLUTION

Aurelien
Google Developer Expert
Google Developer Expert

Hi @NCD 

In my drawing:

- the purple rockets and arrows are for "execute an action on a set of rows"

- the grey arrows are for grouped actions.

I think you got it yet 🙂

 

So, the action "Save | Order" is a grouped action, that will fire:

- "Execute Loop | This order"

- "Auto-delete | Order details"

- "View | This order"

 

On the sample app:

https://www.appsheet.com/templates/How-to-loop-through-a-list-and-create-child-records-for-each-item...

If you have a look to the Action behaviors, you will notice

- "Loop | Create order details" is a "grouped: execute a sequence of actions". It has a condition for triggering.

- "Auto Delete | Order_Details (removed products from order)" is a "execute an action on a set of rows". It actually takes the list of order_details that are NOT in the order table enumList:

 

SELECT([Related Order_Details][OrderDetailID], 
  NOT(
    IN([OrderDetail_Product], [_THISROW].[Order_Products])
  )
)

 

 It also has a condition, which is, in plain text: "above list expression is not blank".

Aurelien_0-1650957501450.png

 

Does that help you to get your (2) ?

View solution in original post

6 REPLIES 6
Top Labels in this Space