History Table Unique Records

I need some help in the database. I am creating a history table, where all actions/votes on a question is listed by workflows. The problem is, when a user clicks on a button “working on it”, I want it to create ONE thing (record) for each question.

How can I guarantee that when the user clicks the button again, another record will not be created for the same question? The problem is… the only way I can identify the uniqueness of this record is through 2 fields, “The User”, and “The Question”.

So should I write a very long if condition in the workflow? (If the user, and the question record exists, don’t create a new one?)

Ok, I have done it this way, and it is working but I would love to know if COUNT = 0 is the correct way, or there is a preferable way as I am a perfectionist and would like the app to be fast. There’s going to be a massive user interaction with this website and no lags are tolerated.

I believe it is the best approach. Bubble focus on making database interaction fast, that’s their primary focus at present and has been for some time. If you really want to understand performance then you should read this thread Performance Q&A guide

1 Like