Help Please with Appsheet Valid_If Statement for checking status of linked Order Items of Main Order

Job ID: 35025463

Budget: $10 – $30 USD

Hi All, I need some urgent help with a Valid_If statement please.

I have a Table for Orders. And I have a Linked Table for Order_Items.
Each of these table's have a "Status" dropdown to select the Status of the Order and the Status of the Individual Order_Items.

I don't want the User to be able to select the Order Status "Closed - Complete" or "Closed - Cancelled" If there are linked Order_Items where the Order_Item Status is not "Packed - Complete" or "Cancelled".

I need the statement to check all the Order_Items and only if all the linked Order_Items have a Status of either "Packed - Complete" or "Cancelled", then you can choose the status for the main Order as "Closed - Complete" or "Cancelled".
Related categories: Google Sheets Google Apps Scripts