Valid If me evita duplicados pero no me permite actualizar registro

Hola a todos!..

En una tabla llamada "Productos" tengo una columna "Cod Viejo/Proveedor", en esta columna tengo en "Valid If" la siguiente fórmula 
COUNT(
SELECT(PRODUCTOS[COD VIEJO/PROVEEDOR];[COD VIEJO/PROVEEDOR]=[_THISROW].[COD VIEJO/PROVEEDOR];TRUE)
)=0

Esto funciona perfecto al momento de la creación de un producto nuevo, sin embargo cuando deseo actualizar algun otro campo en un registro previo no me lo permite porque permanece el valid if asignado.

agradecería mucho me ayudaran.

 

Solved Solved
0 6 141
1 ACCEPTED SOLUTION

Hi @Guillermo_Suare ,

If you refer to the last section of the article I shared earlier, it states the expression to avoid duplicates.

Please try in the valid_if of the column [COD VIEJO/PROVEEDOR] the following expression:

ISBLANK(
FILTER(
"PRODUCTOS",
([_THIS] = [COD VIEJO/PROVEEDOR])
)
- LIST([_THISROW])
)

 

Please note that the part - LIST([_THISROW] in the expression above eliminates the problem you mentioned of not being able to edit an existing row.

View solution in original post

6 REPLIES 6

Please search the community with keywords such as "avoiding duplicates", "preventing duplicates" . Or please take a look at the last section of the article below.

List expressions - AppSheet Help

 

Prueba colocando esa formula en la opcion "Suggested Values" en vez de "Valid if"

"Suggested Values" no funciona para lo que quiero conseguir que es que no me permita registrar un producto nuevo con un codigo existente y que me permita actualizar otros datos de un producto

Hi @Guillermo_Suare ,

If you refer to the last section of the article I shared earlier, it states the expression to avoid duplicates.

Please try in the valid_if of the column [COD VIEJO/PROVEEDOR] the following expression:

ISBLANK(
FILTER(
"PRODUCTOS",
([_THIS] = [COD VIEJO/PROVEEDOR])
)
- LIST([_THISROW])
)

 

Please note that the part - LIST([_THISROW] in the expression above eliminates the problem you mentioned of not being able to edit an existing row.

Muchas gracias! tu opinion me ayudo muchisimo. la modifique un poco y me funciona perfectamente!

Quedó así 

ISBLANK(
FILTER(
"PRODUCTOS",
AND(
([_ROWNUMBER] <> [_THISROW].[_ROWNUMBER]),
([COD VIEJO/PROVEEDOR] = [_THISROW].[COD VIEJO/PROVEEDOR])
)
)
)

 

Muchas gracias Suvrutt_Gurjar 

Guillermo, como sería la expresión para impedir registros duplicados en una columna en particular? Tengo la tabla ARTICULOS y una columna DESCRIPCIÓN y en esta deseo evitar que se dupliquen las mismas descripciones, por favor, tu ayuda. Gracias.

Top Labels in this Space