How to post a Google Sheets Chart as an Image to Slack (or any app)

  • 12 August 2020
  • 1 reply
  • 988 views
How to post a Google Sheets Chart as an Image to Slack (or any app)
Userlevel 5
Badge +2
  • Zapier Staff
  • 19 replies

Hi there! Tim here from Zapier Support with another workflow idea for you :)

Background

I recently had a customer write in with a request: Once a week, they wanted to post a chart from a Google Sheet to a Slack Channel to keep everyone in the loop on the recent progress their team had made. 

The problem? There’s no “Get/Lookup Graph” type of Action or other way to pull that in. 

The Solution

Google Sheets and Google Docs both have a neat feature called “Publish Document” that let you create a link to a version of your document or a specific part of it. You can make spreadsheets and documents available as downloadable CSVs, PDFs, Microsoft formats, and more.

Once published, the “published” version will be updated at least every 5 minutes to reflect changes in the source document. 

Anyone with the link can access the published version, but can’t make changes to the original. The link is long and complicated, essentially serving as a password so that it is virtually impossible for someone to find your published document unless they have the link.

In this case, we can choose to publish just the chart as an image file. Here’s what my spreadsheet looks like:

In Google Sheets, I’ll go to the File menu and select “Publish to the web”:

I’ll click on the drop down that defaults to “Entire Document”, and I’ll choose my chart by name:

Next, I’ll make sure that the publish type is changed from “Interactive” to “Image”:

We’re all set to click “Publish” now, which gives us the Link:

Copy the link URL and keep it handy to use in your Zap.

Here’s the example Zap that I’ve set up to demonstrate the rest: 

You can create the same Zap with this Zap Sharing link: https://zapier.com/shared/cb7934e098f50250c4b635bc46995c09be5534b0

Once a week, it will post a message and upload the current state of the image of the chart to a specific channel in Slack. Of course, you can also send the image of the chart to any app that has a File field, like Dropbox or Google Drive.

Add your “Message Text” to give some context to the chart, and paste your Google Docs Published Document link into the “Attach Image by URL” field:

When the Zap runs or if we test that Step, here’s what it looks like in Slack:

Because we uploaded it, the image that was posted to Slack right now won’t change when the Google Sheet gets further updates, freezing it as a snapshot in time.

That’s it for this week :)

I hope you enjoyed this, and that it sparked some ideas for your own Zaps to help keep your teams up to date!

If you have any questions, please let me know in the comments here!


1 reply

Userlevel 1

This is perfect, thank you Tim, excellent write up, clear and to the point.

I wonder, if there is a way to email multiple google sheet charts? <off to research>

Reply