Best answer

How do I send one-time tokens via email from a Google Sheets spreadsheet?

  • 14 February 2023
  • 3 replies



I have a Google sheet with a column Tokens that has a unique set of tokens. Based on a trigger from Shopify, I would like to send an email each time with a new token.


How can I copy the data of a cell of the column Tokens to use inside the email step? (Should move to the next row every time in order to use a new unique user token).


I tried to find the value of a row and then delete it to toke the upmost one, but that turned out to be a dead end.

Any ideas would be appreciated!



Best answer by Troy Tessalone 14 February 2023, 20:27

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +14

Hi @simpleclub 

Good question.

Add another column to the GSheet (e.g. USED) with values of TRUE/FALSE.


Then use these Zap steps

  1. Trigger: ???
  2. Action: GSheets - Lookup Row
    1. Search by USED = FALSE
  3. Action: GSheets - Update Row
    1. Map Row / ID from step 2
    2. Update USED = TRUE
  4. Action: Gmail - Send Email
    1. Sends with the unique token from step 2
Userlevel 7
Badge +8

Hi @simpleclub 


There are several ways to do that. The easiest way would be: 


  1. You will first add a column in your Google Sheet and call it “Send Code” for example. Values of this column would be 0 and 1. (you can change the default values if you want). In the very first row that you want to send the code from, you will input the value as 1 (leave the others empty). 
  2. Add a Google Sheets step “Lookup Spreadsheet Row” where you will lookup the value 1 in the “Send Code” field. Send this code to your client (using whatever step you already have in place, but it HAS to be the very next step so you dont get confused)
  3. Add a Formatter by Zapier step after the sending step, Event = Numbers, Transform = Spread-sheet style formula, Formula will be the row ID + 1 (see below screenshot)
  4. add Update Spreadsheet Row in Google Sheets step to update the value of the row from the first search to 0
  5. add Update Spreadsheet Row in Google Sheets step to update the value of the row ID you get from the formatter step to 1


Does that help?

Thanks for the answers! Both worked 👌