How to set a value on the parent's table depending on the child's table value?

Hi Community,

I’m trying to find the right expression for the following scenario:

I have a table named “Orders” (Parent) and the second table named “Loads” (Child). Both tables got a column named “Status”. So I want the status on the “Orders” table to change to “Delivered” if the "Loads have been delivered.

If there is still one load “Pending” the status must remain “Pending” on the “Orders” table. Only change to “Delivered” if all “Loads” have been delivered.

it’s cracking my head trying to find the right expression but I have failed in the attempt.

I would appreciate your help with this one Thank you!

Solved Solved
0 2 274
1 ACCEPTED SOLUTION

@Alejandra_Petro ,

I believe, you have a VC [Related Loads] of list type in the parent table “Orders”

Please try an expression something like below in the [Status] column of the parent table “Orders”

IF( IN(“Pending”, [Related Loads][Status Loads]), “Pending”, “Delivered”)

Here [Status Loads]is the name of the [Status] column in the child table “Loads”.

The expression assumes that there are only two statuses possible in the child table “Loads” - 'Pending" or “Delivered” and initial or default status is always “Pending”

View solution in original post

2 REPLIES 2

@Alejandra_Petro ,

I believe, you have a VC [Related Loads] of list type in the parent table “Orders”

Please try an expression something like below in the [Status] column of the parent table “Orders”

IF( IN(“Pending”, [Related Loads][Status Loads]), “Pending”, “Delivered”)

Here [Status Loads]is the name of the [Status] column in the child table “Loads”.

The expression assumes that there are only two statuses possible in the child table “Loads” - 'Pending" or “Delivered” and initial or default status is always “Pending”

Thanks @Suvrutt_Gurjar that works perfectly!

Top Labels in this Space