Collecting data via Google Form and Apple Shortcuts

| 2 min read

A while ago, I started tracking my weight using a Process Behavior Chart (PBC) but stopped, partly because the weighing machine was out of battery, I didn’t get the result I wanted, and because the app I built with AppSheet took too long to load, which was annoying.

Now that I have repurchased some battery, I’m up again for the challenge of losing some weight, and I want to give another try using a PBC to see any change, but I don’t want to use AppSheet again and decided to use an Apple Shortcut instead to collect the data easily.

So here we are: how to set up Google Form and an Apple Shortcut to collect measurements right from your phone to a spreadsheet.

Step 1. Create a Google Form

Head to Google Form homepage, click "Access to Forms", then create a new form.

Next, add as many answers as you need.

In my case, I needed one single answer, a decimal number greater than 0.
View of the Google form setup with one answer

Depending on your phone language settings, the Apple shortcut might send decimal numbers formatted using a comma but Google Form won’t accept that as an answer. Instead of using a number input, use a Regular Expression with ^-?[\d*\,{1-9}]*$ as validation rule.
View of the Google form setup with one answer using the regex

Part 1, done!

Step 2. Prepare the form submission URL

In the form configuration panel, click on the three dots on the top right of the page and click "Get a Pre-Filled link". A page opens. A Pre-Filled form is a way to share a form pre-filled with some information to someone else, to help them input the form faster or for reviewing data before submission.

You will see the form displayed. Enter some data easily, distinguishable. I entered 100. This data will not be added to the results when you submit.

Click "Get the link" and copy it. This is the URL we will use to submit new data from shortcut to the form.

Here is the link I got:

https://docs.google.com/forms/d/e/[REDACTED]/viewform?usp=pp_url&entry.1061001024=100

Look closely, we can see the 100. This is the value we will replace with the each measurement.

Edit the URL to be able to send the new measurements:

  • Replace viewform with formResponse
  • Add &submit=Submit at the end
  • Replace the dummy value with ``

You should get something like https://docs.google.com/forms/d/e/[REDACTED]/formResponse?usp=pp_url&entry.1061001024={value}&submit=Submit

Step 3. Setup the Apple Shortcut

On your phone, or directly from laptop, if you have a mac, open the Shortcut app and create a new shortcut.

Then:

  • Add the "Ask for input" step and set it up to receive numbers. In the options tab, allow for decimal numbers.
  • Add the "Text" step and copy the form submission URL template created in Step 2.
  • Add the "Replace text" step and replace {value} with the data from the input on the text.
  • Add the "Get content at URL" step and use the updated text as the URL.

Your shortcut should look roughly like this
View of the Apple Shortcut

And you should be all set. For convenience, add the shortcut to your home screen for direct access.

To input a measurement, click the shortcut icon, enter a value, press "OK", and you’re done.

A simple trick, just what it takes of development to make life easier. This is a nice alternative solution.

Oh, hey, and, I like finding alternative solutions when I’m helping team to deliver value faster. If you want to see I can help you, let’s have a chat!.