First off, shout out to Jose Monkey for this idea and project code. See his at josemonkey.com/projects/. I came across his project from his TikTok videos that he made. And like him, I modified it to suit me. Shit evolves!
Still need more info? Don't worry, read on...
Login to your Google account. Open up Google Sheets. Create a spreadsheet. I used the following headers:
You will need the spreadsheet ID. To find this, look at your address bar, it's the information between "/d/" and "/edit#":
I got ambitious, and I decided to track multiple storage areas (fridge, freezer, left cupboard, right cupboard). So, just duplicate your "Sheet1" tab and rename if you are as nerdy as me:
optional bonus round: I like everything pretty, and love colours. Sooo, I froze the top row (under view > freeze), centered most of the columns, and applied a conditional formatting to hightlight expired items in yellow.
important note: this entire function just updates this spreadsheet. Nothing stops you from updating or editing it on your own, either. Just take note, if you have more than one item with the same number and you run a remove command, all items with that number get removed.
Login to your Google account. Open up Google Apps Script. Create a new project. I created a new project for each storage area I was creating a script to track (fridge, freezer, left cupboard, right cupboard).
Lets start with the errors I got in the process. Although they may have been impacted by the Siri Shortcut or the Google Sheet, they all were annoying in the Google Apps Script the most:
The code: as I write this on March 26, 2024, I already see Jojo Monkey has added an email function to his code, so his code is evolved differently than mine. Check his out for some great bits!
.txt file download: Copy + paste the code in this text file into your Code.gs file in your project.
Final steps:
I set this up on my Mac, but you can do it from your phone, too. The process is the same. If you've never created a Siri Shortcut (which I hadn't), you just create a new shortcut, and start building the parts you need. I've shown more where ever I could, and I set some default values to make it less repetitive, and added an if statement to make sure there was a product name. Just search for the parts like Set variable, Ask for, and text.
Note towards the end, the text input I have covered in yellow is where you put your deployment URL you got from your Google Apps Script. Every time you re-deploy (/change) your code, you will need to paste the new URL here again. Make sure you change the Get contents of to the POST method.
Once you've created one Siri Shortcut, you can just duplicate, and place the new deployment URL where needed.
Order some NFC stickers (I got mine from Amazon) -- make sure they're stickers, so they have the ability to be stuck onto your cupboard door, etc.
Create an Automation in Siri Shortcuts. You'll want to do this from your phone. Then scroll down and choose the NFC option.
I chose the Run Immedeiately and turned off the Notify When Run options. Then hit Scan, and scan your NFC device at the back top of your iPhone.
It will confirm the tag has been scanned. Then choose the Siri Shortcut you created in the last step.
Stick your tag somewhere, and you're good to start scanning.
optional bonus round: I stuck a couple of these tags around my apartment so I can silently run tasks, light turning on specific LIFX bulbs, etc. Try it out!
scan your tags and populate your spreadsheet. I suggest using a sharpie to number the items, just write on the package.