Ejecutar Data Validity solo cuando se inserte un registro

Buenas noches comunidad,

Cómo lo menciono en el titulo, estoy tratando de validar una columna que almacena un código de un comprobante cuando se ingresa un nuevo registro pero ocurre que cuando quiero modificar un registro ya creado la formula del Data Validity manda error debido a que él código único ingresado para el registro en edición ya existe.

Existe alguna manera de qué la formula solo se ejecute cuando el registro se esté creando y no editando?Captura de Pantalla 2022-10-22 a la(s) 19.31.11.png

Solved Solved
0 16 338
1 ACCEPTED SOLUTION

Please try

ISBLANK((FILTER("TableName", ([UniqueIdBill] = [_THISROW].[UniqueIdBill]))-[_THISROW].[UniqueIdBill])

View solution in original post

16 REPLIES 16

Please employ the technique mentioned in the article referred below to avoid duplicates.

Essentially, you need to remove the current row from the filter expression, as highlighted below.

ISBLANK(
FILTER(
"Table Name",
([_THIS] = [Column Name])
)
- LIST([_THISROW])
)

List expressions - AppSheet Help

 

 

Hi Suvrutt,

I can´t get the idea that you show. Please, Explain me more about it, I can`t solve it yet

If possible, please share your valid_if expression. Then I can suggest changes.

Here is it.

COUNT(FILTER("TableName", ([UniqueIdBill] = [_THISROW].[UniqueIdBill])))<=0

Assuming you are trying to avoid duplicate in the column CodigoFacturaReciboCheque column, please try

 

ISBLANK(
FILTER(
"Table Name",
([_THIS] = [CodigoFacturaReciboCheque])
)
- LIST([_THISROW])
)

 

I made the changes, but it doesn´t work. When I edit one row, the validation always ocurrs and blocks me to save the row change.Captura de Pantalla 2022-10-23 a la(s) 20.14.13.png

The table name in your column description and table name in the expression seem to be different. If so, any specific reason you are doing so?

Yes, the information of ID's I take them from another table that has the IDs.

Please explain what you mean by information of IDs and please restate your requirement more properly. It was not mentioned that the tables are different anywhere in previous description. 

Sorry,

Ok, I have two tables. In the first one, I save the main information. The second one is a SQL View that has just the uniques ID's from the first table. When I make the validation, the formula validates if the unique ID joined is In the SQL View. 

Please try

ISBLANK((FILTER("TableName", ([UniqueIdBill] = [_THISROW].[UniqueIdBill]))-[_THISROW].[UniqueIdBill])

TableName will be the second table(SQL View)?

Yes

I doesnt work, I tried now.

Please try the table name as dbo.Gastos.CuentasProyectos

Thanks Suvrutt, 

This was the solution. 

Regards

Top Labels in this Space