Handle multiple Add clicks, Create record if not present, else update existing one

Hi,

I am trying to make an attendance app and facing issue with duplicate entries. When Admin clicks on “Add Attendance” against an employee name, then one entry should get created for that day. I am using “Date+Employee-Mobile” as one of the columns.

Problem is that without uniqueness check, multiple entries are getting created for same “Date+Employee-mobile” when admin clicks “add attendance” repeatedly.

My question is - is there a way/hack to limit only one entry or “update if record already present” when the “add attendance” button gets clicked second time?

Thanks!

Hi @mars,

This tutorial might be useful:

I need to note, however, that it will not protect against clicking one button very rapidly - the visibility may not work very fast.
So probably it would be good to add the same logic to the button action as well (create only if no record exists).

Hope this helps!

2 Likes

Hi @Victor,

Thanks a lot for all your help. The video was very helpful. I was able to implement the functionality by combining your suggestions and using nested lists. Learned a lot from your other videos as well!

Thanks!

2 Likes