Skip to main content
Question

Unique Identifier on Multiple Fields

  • October 22, 2019
  • 0 replies
  • 236 views

Hi,
Is there a way to set up your Unique Identifier (key) based on multiple field combination? i.e., If I have fields User and Date, I want to restrict to have a specific user on a specific date only once. Same user should only have one record with same date in that table.
In most databases, that's pretty much standard feature to define your own Key based on combination of fields, but could not figure out how to handle this in QB. Any thoughts?
Thanks in advance.

------------------------------
Muhammad Ghazali
------------------------------
This topic has been closed for replies.

  • Registered
  • October 22, 2019
I don't believe this is possible anymore but I'd love to find out a way to do it as well. You used to be able to do it via a formula field and setting it with the API but they made a change somewhat recently that made this impossible to do.

  • Registered
  • October 23, 2019
To add to Marks response, you can achieve this with enhancements to marks response. I do use these kind of scenarios many of the times to control my tables uniqueness 

Follow these steps:
1) Create a text field, e.g. Reference Key, type Text and set this as unique unique.
2) Create a formula text field CF-Reference Key = ToText(UserToEmail(User())) & ":" & ToText(Today()). Replace today with date field. I used UserToEmail becase name can be duplicate but email address cannot.
3) Use the form rule to update the Reference Key field with CF-Reference Key on record save.

If you are uploading the data using import functionality, make sure that your excel or csv file is having the concatenated value.

Happy Quickbasing.


------------------------------
Babi Panjikar
------------------------------