Make a field unique based on condition

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered

Hi All,

 I want to make a field unique based on requirement.

For Example,

I had two fields in a table say X,Y. X should be unique only if Y is different on comparison to other records in the Table.

Valid Scenario:

RecordID   X Y 

1                 h 1 

2                 h 2

Here X need not be unique as Y is different and while I try to add 2nd record it should not throw any error.

Invalid Scenario

RecordID   X Y 

1                 h 1 

2                 h 1

Here X must be unique as Y is having same value.In this case  while adding 2nd record it has thrown an error that X should be unique.

Please help me in solving this.

Photo of Ananth

Ananth

  • 0 Points

Posted 3 years ago

  • 0
  • 1
Photo of Blake Harrison - DataBlender

Blake Harrison - DataBlender, Champion

  • 100 Points 100 badge 2x thumb
There is no way - using native QuickBase functionality - that I'm aware of to do this. This would require that a record has knowledge of other records on the same table, which isn't the case with QuickBase. I would imagine the only way to accomplish this would be to build custom code that could do the comparisons.