Using Zapier with Data Actions

Zapier is a service that allows you to connect applications running on the Internet with each other and send data back and forth. They’ve got interfaces to lots of applications, like Google Sheets, Zendesk, Sendgrid, and lots of others.

It’s really easy to configure Zapier to receive the requests submitted by a Looker Data Action and to use the data in Looker to perform useful tasks in other applications, such as updating Zendesk tickets, sending email through Sendgrid or MailChimp, or sending messages in Slack!

This article will guide you through the basic steps of configuring Zapier to accept these responses. It’s super easy!

Step One: Select the Webhook Application

If you create a new Zap, you will be asked to select a trigger app first. Select Webhooks by Zapier.

Step Two: Select Catch Hook

Select the Catch Hook option, which will configure Zapier to listen for incoming HTTP requests, like our Data Action.

Step Three: Copy the Webhook URL from Zapier

Finally, we’ll copy the URL that Zapier gives us. This is the URL we need to send our Data Actions to, and is where Zapier will be waiting for our requests.

Step Four: Write Your Data Action

Next, we’ll use the URL from Zapier to write our Data Action. You can use this guide on how to write Data Actions, and its at this point that you decide what data goes into your requests. Every parameter and form that you put in the Data Action here will show up in the data that gets sent to Zapier.

Make sure to check for LookML validator errors before you move on to the next step!

If you’ll need any API credentials for doing stuff with the data after Zapier catches the webhook, add them here in a parameter so you can configure Zapier to authenticate to that API.

Step Five: Test the Data Action

You’ll always want to run a test of the webhook before you move on with working on the rest of the Zap, so at this point, we’re going to open up an Explore, add the dimension or measure that we added the Data Action to, and fire off the Data Action.

Step Six: Revel In Sweet Victory

If everything was configured properly and you don’t have any LookML validation errors, then Zapier should report a successful test! Click their link to open up the test data that you sent and examine it to make sure everything looks right.

Next Steps

From here, you can use Zapier to send this data to other services and applications so that you can do meaningful, useful things with it. The possibilities are endless, so let your imagination roam free and make something awesome! Good luck!

Share Your Cool Stuff

Did you make something cool using this guide as a starting point? Talk about it in the comments! We love hearing about how customers are using Looker to make their jobs easier and to do things that they couldn’t do before, and someone else might be inspired by your creation to make something for themselves.

5 Likes

One of the things you can do is use Gmail (or any other SMTP server) to send e-mails directly from Looker.

Let’s say you want to send notification to your manager when an order has been physically dispatched. As described above, firstly, you’ll need to create a Webhook application with Catch Hook option.

Now, you need to add the data_action parameter to your LookML dimension:

  dimension: order_id {
    type: number
    sql: ${TABLE}.id ;;
    action: {
      label: "Tell manager it's dispatched"
      url: "https://hooks.zapier.com/hooks/catch/22asd21dav9dsad92x/"
    }
  }

If the webhook test is successful, you can start working on the second part - e-mail template configuration:

Step 1: Choose your app (Gmail) and select Send E-mail:

Step 2: Choose account or connect to a new account (all e-mails will be sent form that account)

Step 3: Setup a template. Fill all required information. It’s pretty much the same process as with sending a normal e-mail. The added benefit is that you can dynamically use the value from your dimension anywhere in your e-mail. For example use the Order ID in the Title and a Body of the triggered e-mail:

Step 4: Once you save that configuration, your Zap is ready to be named and turned on!:

Now you can use the data action in your explore. Simply click on the action next to your order and the automatic e-mail to your manager will be triggered:

And that’s what Patrick should receive

5 Likes

Using Zapier’s Webhook you can also have SMS sent out based on your data actions!
The following will show you how to implement this using MessageBird.

1/ Go to Zapier and search for MessageBird:

2/ Select the appropriate Template (Webhook to MessageBird):

3/ Setting Up the Webhook (following template):

4/ At this step we will want to copy the generated webhook to bring into our LookML

5/ Define the field to use the LookML action

  dimension: orders_update {
    description: "Update for Orders to SMS"
    sql: ${TABLE}.field) ;;
    action: {
      label: "outgoing text"
      url: "https://hooks.zapier.com/hooks/catch/31995216/f4ei6d/"
      icon_url: "https://cdn-gc.messagebird.com/assets/images/glyph.svg"
      param: {
        name: "sms"
        value: "{{ value }}"
      }
    }
  }

6/ Go to the explore and select that field, and click on the action:

7/ See the test successful in Zapier:

8/ Start setting up the MessageBird specific part of the mechanism:

9/ Connect to your MessageBird account (You will have to have an account created and provisioned to continue):

10/ You will be prompted to add the access key that was created on your account (Making sure the key your created is of type LIVE, not test):

11/ Additional account set up, naming this Zap:

12/ Editing the template (add origin number, content of sms, list of recipients and other optional parameters):

13/ Set up is complete!

14/ Go to your explore and start sending SMS

15/ Get the SMS!

This can also be done with Twilio.