LookUp Problem

Hi, I have a problem, perhaps a sily one.

I have 2 tables: “Detalle Cuotas” and “Pagos”

In the table “Pagos”, there’s a column called “Estado Pago” and the initial value it’s “Sin Pago”.

Also, I have a Input Action in this table thar changes the “Estado Pago” from “Sin Pago” to “Pagado” or “Saldo Pendiente”.

Well, what I need to do is copy the column “Estado Pago” from table “Pagos” to table “Detalle Pagos”.

I tried with Lookup (Lookup([ID_DetalleCuotas],“Pagos”,“Detalle Cuotas”,“Estado Pago”) and with dereference, but I can’t do it.

Table Detalle Pagos

Table Pagos

Yeyo1976_3-1716422799940.png

Thank’s!

There seems to be some confusion in table names. You have mentioned table name “DetalleCuotas” in the table image but in description sometimes you are mentioning “Detalle Pagos”. Could you clarify?

In general it sounds that you could use reference actions to update a column from one table to another. You already seem to have a reference relationship in place. However you also seem to be updating parent table from child table. If so, you may need to think of which child record from the related records you wish to use to update the parent status. This is so because in majority of the cases there are multiple child records for a parent record.

Actions: The Essentials - AppSheet Help

Reference Actions - AppSheet

You’re right, the table calls “Detalle Cuotas”.

But I only have one reference between this two tables: from table Detalle Cuotas to Pagos only for reference and fot try the dereference.

I only need to push the value “Estado Pago” from table “Pagos” to the column “Estado Pago Detalles”.

I used Lookup several times, but now it doesn’t work =(

Yes, you can try the reference actions. Please take a look at the shared article and sample app to know reference actions.

Thanks, I checked the doc and see the APP, but can’t solve my problem.

I’ll keep searching!

Thanks

In general, you need to create a reference action that updates the parent record from the child table. The sample app updates the child table column values from parent table. In your case the flow is reverse- from child table to the parent table.

Hi, thanks for the answer, but why this expression doesn’t work?

LOOKUP([ID_DetalleCuotas],PAGOS,Detalle Cuotas,Estado Pago)

If the column Detalle Pagos in the table Pagos is the same value of ID_DetalleCuotas in the table Detalle Cuotas

Both column in green.

I ask because I think that the solution it must be really simple, but perhaps I missed something in the process.

Just for initial value , please try

LOOKUP([_THISROW].[ID_DetalleCuotas], “PAGOS” ,“Detalle Cuotas” ," Estado Pago")

Please take a look at the article below for why it is necessary to use [_THISROW] under the “Troubleshoot” section.

LOOKUP() - AppSheet Help

1 Like

Thanks!

Doesn’t work.

I think for initial value to work in your case, please enable reset on edit. Please note that as the name suggests, the “initial value” works only when record is created if “reset on edit” is not enabled for the initial value setting.

Also in your case the use of “initial value” is somewhat unusual. You are updaing parent record 's initial value from the child record. But a child record will be only available once parent record is created. So in the first creation of parent record, the initial value will not populate.

On edit of the parent record second time onwards , it will work.

Also please note that in AppSheet physical columns update only on edit of record or through actions or bots. Just by entering expression, the column values in existing records will not update.

That is why a “reference action” on child record save may be a better option in your case.

Edit: Please take a look at the following help article on the initial value,

Please note below

Define app formulas and initial values - AppSheet Help

Hi, thanks.

Yes, first I created the table “Detalles Cuotas” and then I created a movement called “Pago”, where the initial value for this row is “Sin Pago” (in table Pagos), then when I check the bank account if the money is there, and with an input in the table “Pagos” the column “Estado Pagos” change from “Sin Pago” to “Pagado”, and I need that this new value in “Pagos” reflect in “Detalles Cuotas” table.

Thenm when this column change to a Pagado, I filter the view for the customer with a Slice, so they only see the unpaid data.

I tried with the Initial Value and check the “Reset on Edit” but also doesn’t work.

Why the dereference doesn’t work?

I have a ref from “Detalles Cuotas” to “Pagos” (Column Reference) and the use this expression “[Referencia].[Estado Pago]” and nothing happends.

Thanks, with the virtual column worked!!

Thank you share your knowledge !

1 Like