A *service case study: Using Zapier and IFTTT to connect to Google Sheets

There are two awesome tools we want to highlight that you can use with *service to connect your GuidedTrack program to the APIs of hundreds of other apps and services – Zapier and IFTTT.

For example, you could potentially do the following:

  • Save a date in your Google Calendar or Calendly
  • Add to-do items to Trello or Todoist
  • Send important info to Evernote
  • Show an event via Eventbrite
  • Show the weather or photos from NASA
  • . . . and more!

As outlined here, you can also send GuidedTrack variables to a Google spreadsheet, which would mean your sheet would be populated in real time by users taking your program.

There are a number of ways this could be useful, for example:

  • Easily see your most important data arrive in real time.
  • Add formulas for to your spreadsheet to do automatic calculations.
  • Efficiently share specific data with others.

The two services covered are:

  • Zapier: Zapier is a tool that connects multiple apps to each other. The *service keyword will send data to Zapier, which will in turn populate the appropriate columns in a Google spreadsheet. If you want to send data from GuidedTrack to Zapier you will need a Premium account, but currently you can try it for free for 14 days.
  • If This Then That (better known as IFTTT): IFTTT is another service that connects apps with each other. With IFTTT, you can send user data an unlimited number of times, but you are limited to populating only three columns.

Using Zapier with GuidedTrack (for instance to add a row to a google spreadsheet)

1. Prepare your spreadsheet

Go into google spreadsheets (http://spreadsheets.google.com) and create a new google spreadsheet that will be the one you’re adding rows to via GuidedTrack. Fill in the the first row of this spreadsheet with the column names (for example, “Customer’s name”, “Customer’s age”, “Registered on”, “At”):

2. Write your program

Here you have the sample code to send four variables to Zapier, see how you can use both text and number variables:

>>name="Peter" >>age=34 >>date="October 15th, 2013" >>time="9:33 am" Sending data to google sheets… *service: zapier *path: / *method: post *send: {"Name" -> name, "Age" -> age, "Date"->date, "Time"->time} *success Success! >>result = it *error Failure! >>result = it *Response from zapier server*: {result} *button: Done!

3. Create and test a Zap

  1. Create a zapier account at: https://zapier.com.
  2. On the dashboard click Make a Zap!
  3. You will now be asked to select a trigger event to start the Zap. Click on the Webhook icon.
  4. Select Catch Hook on Trigger Event and then click on Continue.
  5. Zapier will give you a Custom Webhook URL. Copy it to your clipboard.
  6. Switch to the tab where you have your GuidedTrack program and go the program Settings. Go to the Service tab and create a New Service. Use the URL on your clipboard and name the service zapier. Leave empty all the other fields and save.
  7. Click preview in GuidedTrack to run the code. If you have configured the service correctly, you will see on the screen that the status of the response from Zapier is Success. This means that GuidedTrack is communicating with Zapier.
  8. Go back to the tab or window where you have Zapier to check that it is receiving the data correctly. Click on Continue and then on Test your trigger. It should display the fields Name, Age, Date and Time populated.
  9. GuidedTrack is communicating properly with Zapier, now you will be configuring what Zapier does with the message received from GuidedTrack. Click Continue and select Google Sheets.
  10. Zapier will ask you to choose an action event. Select Create Spreadsheet Row and Continue.
  11. Connect to your Google account (you may have to grant Zapier access to it if you have not done it before). Then, Continue.
  12. Select the Google drive where the spreadsheet is located, the spreadsheet and the tab (worksheet) where the table you created is. Map the data that Zapier receives to the columns of your target table as shown below and Continue.

13. Click on Test & Continue. The following screen should display a message saying that the test was successful. Go to your spreadsheet and check that a row was created:

14. If everything looks right, go back to Zapier, click on Turn on Zap and you’re done!

Using IFTTT with GuidedTrack (for instance to add data to a Google spreadsheet)

Note: when it comes to Google spreadsheets, IFTTT is unfortunately limiting to only adding rows that have no more than 3 columns of data. Use Zapier if you need more than 3 columns.

Step 1: Create an IFTTT account at https://ifttt.com

Step 2: Once past the onboard, type “sheets” in the search/filter box, click on the “Services” tab, and click on Google Sheets

Step 3: Click “Connect” and then set up the connection with your Google Drive / Google Sheets account

Step 4: Click your username in the upper right and choose “New Applet”

Step 5: Click on “this” in the “if this than that” and search “webhooks” in the search/filter  then click on it. Then click “Receive a web request”

Step 6: Give it the event name: guidedtrack_data

Step 7: Now click on “that” in the “in the “if this than that” and search Google Sheets and click on it. Then click “Add row to spreadsheet”.

Step 8. Fill in the form to give the spreadsheet a name and choose a path where it will be saved within Google Drive if you like. Leave the “formatted row” unchanged for now. Click “Create action” then click “Finish”.

Step 9: get your webhook key, which you can find here:

The key is the last part in the URL shown, the last part of:

Step 10: Create a new guidedtrack program, so you can test out sending data to your google spreadsheet.

Step 11: Once you’ve created this GuidedTrack program, go to its editor window, then click “Settings” then click “Services” then click “New Service.”

Fill in this info:

Name: ifttt

URL: https://maker.ifttt.com/trigger/guidedtrack_data/with/key/YOUR_KEY_HERE

where guidedtrack_data is whatever event name you set before, and YOUR_KEY_HERE here is the key from the ifttt webhook settings page.

You do not need to enter a username or password.

Then click “save” to save your service.

Step 12: Go back to the GuidedTrack code editor, and put in this code:

Sending data to google sheets…

>> value1 = 100

>> value2 = 19

>> value3 = 24

*service: ifttt

        *path: /

        *method: post

        *send: {“value1″->”{value1}”, “value2″->”{value2}”, “value3″->”{value3}”}

        *success

                >> result = it

        *error

                >> result = it

*Message from ifttt*: {result}

*button: Done!

Try previewing this program a couple of times to send data to your spreadsheet.

Step 13: Open up google sheets (http://sheets.google.com) and look for a folder IFTTT in your google drive. Go a couple folders deep inside that folder to find your spreadsheet! (unless you edited the path it got saved to, in which case it’ll be located wherever you indicated). If you wish, you can add column headers. You can also remove text you do not need from the GuidedTrack code (such as “Sending data to Google Sheets”).