![[IMG-Automate Your Gains-20250713163417973.png|500]]
---
Fitness has always been a key part of life. Most of this is due to my background in maintaining hobbies and jobs that required a lot of physicality, see my [[About Me]] for more details 😉. This has lead me on a journey of tracking workout routines. At first this started off with a simple notepad which eventually lead to using a notes app, and eventually using Google Sheets. Over the years, the sheet workout templates have gone through several changes.
</br>
### Examples of Google Sheet Workout Logs I’ve Created Over the Years.
**Sample 1** </br>
![[IMG-Automate Your Gains, Part 1 - Plan a Custom Workout App with Google Sheets-20250624231322693.png|500]]
</br>
**Sample 2** </br>
![[IMG-Automate Your Gains, Part 1 - Plan a Custom Workout App with Google Sheets-20250624231322848.png|900]]
</br>
**Sample 3** </br>
![[IMG-Automate Your Gains, Part 1 - Plan a Custom Workout App with Google Sheets-20250624231322984.png|500]]
</br>
While functional, these sheets highlight a growing problem. A background in software and data engineering leads to one persistent question: "How can this be automated?"
</br>
## **Why Spreadsheets Alone Aren't Enough**
The primary issue with using mobile spreadsheet applications for workout tracking is a UI not optimized for quick data entry. Entering data requires pinching, zooming, and navigating a sheet between sets, which can become a frustrating experience that disrupts the flow of a workout.
</br>
## **A Better Way: Automation with Google Apps Script**
One solution to the spreadsheet input problem is to use a form as input. Google Forms could be used, but something more intuitive is required for this project. This application would need to both receiver and send data to a data source (Google Sheet). Since the data already sits in Google Sheets, why not build a solution on that same platform? This is where [Google Apps Script](https://developers.google.com/apps-script) enters the picture. Apps Script is a cloud-based JavaScript platform that is built to integrate across Google products. Also, I have extensive experience with this platform.
```js
// A simple function in Google Apps Script
function helloWorld() {
Logger.log('Hello, Automated Gains!');
}
```
Working with Apps Scripts would also mean I would be using Google Sheets as... my database.
![[GIF-Nathan Fillion UMM WAIT.gif|400]]
For a small personal project that would have only one user this shouldn’t be an issue, but if this were a company project, then this would indeed be issue. Also, I was was able to find an example of a company that used Google Sheet for database work during the beginning of it’s early years, Levels.fyi.
Article: [How Levels.fyi scaled to millions of users with Google Sheets as a backend](https://www.levels.fyi/blog/scaling-to-millions-with-google-sheets.html)
Basically, the initial version of their site had no traditional backend; user-submitted data was written to the sheet via AWS Lambda, and read operations involved processing the sheet into JSON files for the frontend. This approach worked for two years before they began migrating to a more traditional database to handle the growing scale and complexity.
</br>
## The Plan: From Data Entry to Progressive Overload
![[IMG-Automate Your Gains, Part 1 - Plan a Custom Workout App with Google Sheets-20250624231323168.gif|400]]
The goal is to build a web app with Apps Script that not only simplifies inputing workout data but also helps to automate the process of determining progressive overload by tracking the Rate of Perceived Exertion (RPE).
</br>
### What is RPE?
RPE is a subjective measure of workout intensity that can be used to guide training decisions.
RPE stands for "Rate of Perceived Exertion." It's a subjective measure of workout intensity, typically on a scale of 1-10, indicating how many repetitions were left "in the tank" after a set.
| RPE | Description | Reps in Reserve (RIR) |
| :----------------------------- | :------------------------------- | :-------------------- |
| <font color="#ff0000">10 | Max Effort, No Reps Left </font> | 0 |
| <font color="#ffc000">9 | Ver</font>y Hard, 1 Rep Left | 1 |
| <font color="#ffc000">8</font> | Hard, 2-3 Reps Left | 2-3 |
| <font color="#ffff00">7</font> | Challenging, 4-5 Reps Left | 4-5 |
By tracking RPE alongside weight and reps, it becomes possible to programmatically determine when to increase the intensity of a workout. For example if an exercise is marked as having an RPE of 8 or below, then technically it should be ok to move forward with the next step in the workout plan, that assuming that weight, sets, and reps for the planning workout were also used. If they weren’t then the user (me) should input an RPE hiring than 8 along with some notes on what happened.
</br>
## **Conclusion: What to Expect**
This post introduced the problem of inefficient workout tracking and outlined a plan to build a custom solution using Google Apps Script. The goal is to create a streamlined data entry process and lay the groundwork for automated training recommendations.
**In [[DEV_ Automate Your Gains - Part 2 - Google Sheets and Apps Script|Automate Your Gains - Part 2]] , we will dive into the code and begin the actual build of the web application.**
</br>
---
## Resources
</br>
### Github and Demo
You can find the completed code for the entire project, including all features and documentation, on GitHub.
- **[View Project on GitHub](https://github.com/drusho/workout-logger-google-apps-script)**
- **[Try the Live Web App Demo](https://script.google.com/macros/s/AKfycbwiQyKHvKap9oiKqSpAhFdbq9xH36wOZCr0a6QRZEgSL0ErCWXhaUoVAIPcqD1zM_2I/exec)**
</br>
### Related Articles
Check out the other articles from **Automate Your Gains** series:
%% DATAVIEW_PUBLISH_CONVERT start
```dataview
LIST WITHOUT ID
"**" + file.link + "** </br>" + description + "</br></br>"
FROM "07 - Publish - Obsidian"
WHERE
publish = true
AND file.name != "About Me"
AND file.name != "Home"
AND file.name != "Series - Automate Your Gains"
AND series = "Automate Your Gains"
SORT date DESC
```
%%
- **[[07 - Publish - Obsidian/Articles/A Deep Dive into the 'Automate Your Gains' Workout App UI & Features.md|A Deep Dive into the 'Automate Your Gains' Workout App UI & Features]]** </br>Take a tour of a custom workout logger built with Google Apps Script. See its mobile-friendly UI, dynamic workout planning, "last workout recall," and automated progression features in action.</br></br>
- **[[07 - Publish - Obsidian/Articles/Automate Your Gains, Part 1 - Plan a Custom Workout App with Google Sheets.md|Automate Your Gains, Part 1 - Plan a Custom Workout App with Google Sheets]]** </br>A fitness app project that shows how to plan a smart workout logger using Google Apps Script and Google Sheets to automate your training.</br></br>
- **[[07 - Publish - Obsidian/Articles/Automate Your Gains, Part 2 - Build a Workout App UI with Apps Script.md|Automate Your Gains, Part 2 - Build a Workout App UI with Apps Script]]** </br>Turn a Google Sheet into a database and build a mobile-friendly UI with Google Apps Script. A step-by-step guide to creating the foundation for the workout logger.</br></br>
- **[[07 - Publish - Obsidian/Articles/Automate Your Gains, Part 3 - Save Form Data to Google Sheets with Apps Script.md|Automate Your Gains, Part 3 - Save Form Data to Google Sheets with Apps Script]]** </br>Connect front-end to your back-end. This guide covers using google.script.run to capture HTML form data and save it directly to Google Sheets, creating a complete "write path."</br></br>
- **[[07 - Publish - Obsidian/Articles/Automate Your Gains, Part 4 - Read & Display Data from Google Sheets in Your App.md|Automate Your Gains, Part 4 - Read & Display Data from Google Sheets in Your App]]** </br>Close the data loop for the workout app. Fetch, filter, and sort data from a Google Sheet backend and display it dynamically into web app's UI for a richer user experience.</br></br>
- **[[07 - Publish - Obsidian/Articles/Automate Your Gains, Part 5 - Code Smart Automation for Your Fitness App.md|Automate Your Gains, Part 5 - Code Smart Automation for Your Fitness App]]** </br>Elevate the app from a simple logger to a smart training partner. Code automation logic that analyzes user performance (RPE) to recommend workout progressions.</br></br>
- **[[07 - Publish - Obsidian/Articles/Automate Your Gains, Part 6 - When to Scale Your Google Apps Script Project.md|Automate Your Gains, Part 6 - When to Scale Your Google Apps Script Project]]** </br>A complete review of the workout app project. Covers the pros and cons of using Google Sheets as a database, ideas for future features, and how to know when it's time to migrate.</br></br>
- **[[07 - Publish - Obsidian/Posts/Series/Automate Your Gains.md|Automate Your Gains]]** </br>Articles related to creating a workout logger web application using Google Sheets and Apps Script</br></br>
%% DATAVIEW_PUBLISH_CONVERT end %%