Aug 22, 2022 08:17 AM
Is it possible to create an automation that will create a record at the end of the day if a student is not marked absent they will be counted as present.
I have a form for teachers to fill out when a student is absent. However, I want to create something that will also count when a student is present, not just the change to present. For example, if there is a class of 4 students and everyone is in attendance then I would get a record at the end of the day where 4 different records were created saying that all students were present.
Is there a script that is possible for this? Currently, my automation is grouping all four “present” students into a single record and I want a different record for each.
Solved! Go to Solution.
Aug 23, 2022 05:22 AM
Hi @Carrie_Moy ,
Sorry for the late reply.
IF(OR(AND(DATETIME_FORMAT(NOW(),'H')>=13,DATETIME_FORMAT(NOW(),'H')<=24),AND(DATETIME_FORMAT(NOW(),'H')>=0,DATETIME_FORMAT(NOW(),'H')<=1)),"Trigger")
This formula only works on GMT timezone (we can change it to whatever timezone you need). So this basically triggers at 1 PM GMT up to 1 AM GMT. You can change the numbers as needed.
You can then put an extra filter in the view you made that has the present students to include this new formula field and set it as Not Empty.
The automation will then work on this new view as a trigger to create whatever records you need in the attendance table.
Aug 22, 2022 08:27 AM
I don’t know JavaScript, so for me personally, the easiest way to do this would be to use Make to create an automation that does a search once a day for the students that you’re looking for, and then creates new records for those students.
Your Make scenario could be as simple as these 2 steps:
Other people might have other ideas for you as well. There are also workarounds to do this sort of thing with Airtable’s native automation steps, which I describe in more detail in this BuiltOnAir podcast episode:
Aug 22, 2022 08:28 AM
Hi @Carrie_Moy ,
Welcome to Airtable Community !
If you are creating a record for absent, this means you are linking the absent to the student, correct? Or is it a separate record without any linking?
If so, then you can create a view in the Student table where there is no record created today which means they are Present. Please this view you can send the daily email or you can create the records you need
Aug 22, 2022 08:37 AM
Thank you! I have a form that can be filled out allowing the teacher to change the status from present to absent. That then links the form submission to the student table. I want present to do the same kind of linkage. The student table already has students and new records will not be created each day. I want a new record in my form table for each student when the student status does not change to absent. Is this possible?
Aug 22, 2022 08:40 AM
Hi Scott,
I would prefer to use a native automation in AirTable if possible. Do you know where in the video I should focus?
~Carrie
Aug 22, 2022 08:42 AM
Hi Scott,
I would prefer to use an airtable native automation is possible rather than investing in a third-party application. Do you know where in the video I should focus?
~Carrie
Aug 22, 2022 08:43 AM
Yes, that is possible with the automations.
If I understand correctly, you already have an automation but it creates one record only, we can start from there, share a screenshot of it if you like.
What I would do is:
Aug 22, 2022 08:51 AM
I don’t know if my trick will specifically apply to your scenario, but it might! I start my demo around 29:12 in the video.
Aug 22, 2022 09:10 AM
Here’s the automation I have so far…
If a teacher marks the student in the form as absent, this will update the record in students table to be absent and the session attendance table will be linked to the student record.
Aug 22, 2022 09:28 AM
That is great. Im assuming the records you have in this view are the correct records? i.e. students whom were present?
We might need to add a formula field since you want to trigger this at a specific time I assume?
You can start a new automation that looks for records in this view and creates new records based on those records. Im currently not on my computer but I can do it later tonight if you want