Check unicity of a record based on several fields

Hello !

I'm trying to add a control to avoid creating duplicated data.. 
In particular, I need to check 4 different columns to know if a record is or not a duplicated one. 

I know how I can check the unicity on a single field, but, is it possible to do the same on several fields? 
If yes how? 

Here the expression for 1 single column:

 

 

ISBLANK(
  FILTER(
    "Projects",
    ([_THIS] = [RFP])
  )
  - LIST([_THISROW])
)

 

I was thinking to use a virtual column, but, if it is possible I would like to avoid it. 
The virtual column needs time to be computed during each sync.. 

Thanks in advance!

Solved Solved
0 3 96
1 ACCEPTED SOLUTION

I believe using concatenation of four fields with a VC may not cause so much of delay because anyway those fields are from the same record, you are checking the valid_if and the FILTER() formula you are using itself is multi row formula that anyway filters across multiple rows, thereby being sync time expensive.

However if you wish to check using separate values without a VC, you could evaluate if you are changing those values through a form and you could then concatenate them using a real column and use the concatenated column in the FILTER() expression.

Other not so good alternatives could be to modify the FILTER() expression  as  below

If any one of the values should not repeat in any of the previous rows

ISBLANK(
FILTER(
"Projects",
OR([_THISROW].[Column 1] = [Column 1], [_THISROW].[Column 2] = [Column 2], [_THISROW].[Column 3] = [Column 3], [_THISROW].[Column 4] = [Column 4])
)- LIST([_THISROW]))

If all  of the values should not repeat in any one of the previous rows

ISBLANK(
FILTER(
"Projects",
AND([_THISROW].[Column 1] = [Column 1], [_THISROW].[Column 2] = [Column 2], [_THISROW].[Column 3] = [Column 3], [_THISROW].[Column 4] = [Column 4])
)- LIST([_THISROW]))

Edit: Corrected one typo of missing parenthesis in the expressions.

View solution in original post

3 REPLIES 3

I believe using concatenation of four fields with a VC may not cause so much of delay because anyway those fields are from the same record, you are checking the valid_if and the FILTER() formula you are using itself is multi row formula that anyway filters across multiple rows, thereby being sync time expensive.

However if you wish to check using separate values without a VC, you could evaluate if you are changing those values through a form and you could then concatenate them using a real column and use the concatenated column in the FILTER() expression.

Other not so good alternatives could be to modify the FILTER() expression  as  below

If any one of the values should not repeat in any of the previous rows

ISBLANK(
FILTER(
"Projects",
OR([_THISROW].[Column 1] = [Column 1], [_THISROW].[Column 2] = [Column 2], [_THISROW].[Column 3] = [Column 3], [_THISROW].[Column 4] = [Column 4])
)- LIST([_THISROW]))

If all  of the values should not repeat in any one of the previous rows

ISBLANK(
FILTER(
"Projects",
AND([_THISROW].[Column 1] = [Column 1], [_THISROW].[Column 2] = [Column 2], [_THISROW].[Column 3] = [Column 3], [_THISROW].[Column 4] = [Column 4])
)- LIST([_THISROW]))

Edit: Corrected one typo of missing parenthesis in the expressions.

@Suvrutt_Gurjar thanks for your answer! 

Then, let's say that I use the solution "AND([_THISROW].Column 1] = [Column 1], [_THISROW].[Column 2] = [Column 2], [_THISROW].[Column 3] = [Column 3], [_THISROW].[Column 4] = [Column 4])"

Where should I put this expression? 
I mean, should I put just inside one of the 4 column and that's all? 


@mSalv wrote:

I mean, should I put just inside one of the 4 column and that's all?


Yes, correct. In valid_if of one of the 4 columns.

Top Labels in this Space