Limitations and Use
This tools and steps are provided to customers in order to integrate a Google Workspaces Google Sheet with a daily attendance report.
These steps assume the operator knows the following:
- The API token in ManageBac can be created, with permissions
- It is the user's responsibility to protect the API token as as a sensitive password
- AppsScripts is a platform hosted by Google that connects its spreadsheet service to a coding project, and has quota limitations that may limit how much data can be downloaded
- Some basic knowledge of JavaScript may be required to get expected outputs
Getting Help
Please note that our help support is not available to assist with troubleshooting issues encountered using the technologies mentioned in this article. For community support, feel free to join our Tech Director Community where you can discuss and post questions.
How to
Steps to get a daily homeroom attendance report:
- Navigate to this repo and make a copy of the spreadsheet.
- Go to the AppsScripts project and change the timezone to your native timezone
- Enter the ManageBac API key in Globals.gs -> MB_AUTH_TOKEN area
- Navigate to the ManageBac.gs file and execute the run_MB_Yeargroups function.
- Navigate back to the sheet and find the tab with mb_yeargroups. Collect the year group IDs for the respective Year Groups for which hr attendance you want to extract
- Populate the year_group_ids array with the target Year Group IDs.
- Navigate to the ManageBac.gs file and locate the run_MB_HRAttendance_byDate function
- There are lines in the code that define start_date and end_date variables. It will fetch attendance records for those dates, inclusive. You can define for one day, or for a few days. Longer durations have bigger risk of exceeding quote limitations for the Google platform.
- To get "today and only today" attendance, you can define those variables manually in YYY-MM-DD format, or use JavaScript to build it dynamically:
```
const today = new Date().toISOString().substring(0, 10);const start_date = today;const end_date = today;```
When completed successfully, there will be a tab in the sheet that has the exported data.
When you run the function, it will use ManageBac's APIs and put the information into columns and rows. In this way, it will be possible to run reports on the data with the native spreadsheet formula. Furthermore, users can connect the spreadsheet to Looker Studio for more sophisticated data management and to build dashboards.