Blocking duplicate values

Hi everyone!

I have a table with NAMES with three columns:

givenName
surName
name (=CONCAT($givenName," ",$surName))

And the values:

Eduardo | Dalcin | Eduardo Dalcin
Natalie | Grist | Natalie Grist
Dimitri | Grist | Dimitri Grist

There is any way to block or inform that there is already an “Eduardo Dalcin”, If I try to add it again?

Thanks in advance!

Eduardo

Hi Eduardo!

You can use conditional formatting to change the Cell Style when a duplicate exists. Under the Column configuration panel on the right-hand side of the screen, click ‘Add conditional style’ under Cell Style.

image

Then add the formula to check if more than one of that name exists. The formula will follow this format:

len(TABLE_NAME.lookupRecords(COLUMN_NAME=$COLUMN_NAME))>1

TABLE_NAME is the name of the table where you are checking for duplicates and COLUMN_NAME is the name of the specific column you are checking.

After creating the conditional statement, be sure to update the cell style to make it stand out.

Thanks Natalie! But, I’m having this:

image

Ah, sorry about that! Be sure to use the Column ID (not name)! You can find the Column ID at the top of the column configuration panel on the right-hand side of the screen. Basically, replace any spaces or non-alphanumeric characters with _ to get the ID. For dwc:taxon:scientificName, the column ID would be dwc_taxon_scientificName

1 Like

Aha! My fault… sorry about that! :heart:

image

Sweet! :smiling_face_with_three_hearts:

2 Likes

Hi! Re-open the thread to ask for checking duplicates on, for example, “Last” (name). The same formula doesn’t work @natalie-grist ! Thanks in advance!

There is an example of checking duplicates in this publicly shared doc: Finding Duplicates - Grist.

Also, there is now a recipe for it in the formula cheatsheet: Formula Cheat Sheet - Grist Help Center

Does it help? Or maybe you could share what your formula is and what error it shows?

Thanks Dmitry,

You ALWAYS need a “helper column” to do this, right?

I think @natalie-grist’s first response – with conditional formatting approach – should work without a visible helper column.