Prevent duplicate entries

I have created a small app for marking students attendance in a physical class. This is to be used by a teacher teaching in a slum cluster. I am able to select the date and mark bunch of students as present or absent.
How do I prevent duplicate entries on the same date i.e how do I ensure unique entries in the date column?

Thanks a lot

Hi Annie, may I ask how many students do you have for this class and is this expected to change in the future?

Yes, the nos. could change. However, I have kept the change as manual update to the Google sheets as my competence with Glideapps was basic. So used an example I saw and created columns with names of the students and their attendance status as True or False. The date is the first column.
Thanks

Yeah that would be my approach as well, so if the teacher wants to check attendance for a new date, you can add a new form with a date picker for the date column, then a checkbox for all other columns of student names, providing you don’t have too many students in the class then it should work.

So the teacher can’t accidentally enter the same date again in the date picker and end with 2 sets of records for the same date?

If you want to prevent that, the date must be written to a column in the tab that you have the form button. Let’s say the “Home” tab for example.

Create a relation matching that date choice column’s value back to the date column in the “Attendance” sheet. If the relation is not empty (the teacher has chosen a date that duplicates) then don’t show the button (via a conditional visibility linked with the button), else show the button.

Many many thanks, will try this out.

1 Like

Let me know if I can help, forgot to tell you that after the initial choice of date, you can later catch it via the Columns component to write to the Date.