I'm homeschooling 5 children this year (how am I that old?!). I have tried to streamline the process of attendance for a l.o.n.g. time.
I thought, "I'll use a Google Form that they will simply select their name and the date. (They can't cheat me on attendance because it should match the timestamp. Shhh.)
Here is the form: Google Form for Attendance & Google Form for Attendance drop down
The information from the form presents in my Google sheet as: Google Form Data
I have several students that have attendance sheets: Several Student Records
My student record looks like this: Student Record
What I need help with: I need a P to be placed in the Student Record in the correct date as it is validated according to the information in the Google Form Data.
I need this to repeat for all of my student records. To search the data from Google Form Data and put the P in the correct places.
I think I may be making it more difficult than it needs to be, or I need to set up my sheets a bit differently.
You can use Form Submit Installable trigger in Sheets, so that whenever a form was submitted, the script function will be triggered to update the student record and place "P" on the date submitted.
Sample Code (Inbound script in your Google Sheets):
Pre-requisite (Create a form submit trigger):
What it does?
UpdateStudentRecord()will be executede.valuesArray.flat()to change 2-d array to 1-d array. Search for the date string obtained in step 4 using Array.indexOf()Array.flat()to change 2-d array to 1-d array. Search for the day obtained in step 4 using [Array.indexOf()]Note:
In this sample code, the sheet name should match the student name in form's drop-down list.
Output: