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

  • 12 August 2020
  • 5 replies
  • 4204 views
How to post a Google Sheets Chart as an Image to Slack (or any app)
Userlevel 7
Badge +3
  • Zapier Staff
  • 21 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!


5 replies

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>

Userlevel 1

It seems like this is no longer possible as I can’t find out how to publish my Google Sheet as an image to the web. Is that the case?

Userlevel 1
Badge

@thinkbullish - This works for me to publish to the web. In google sheets you can search help for “publish to web” or just “publish” usually works to navigate to the right place.

 

BUT for me the “Attach image by URL” is not working. I see the link is valid and shows my image but during testing no image comes through at all.

I have been trying to do something similar to this - but with the added feature of re-publishing the image to Discord each time the chart is updated.  It is working, with one exception - Zapier keeps posting only the original version of the chart.  I can hit the chart URL and see that it has been updated, but I presume Zapier (or Discord?) must be caching the original image.  

@thinkbullish - This works for me to publish to the web. In google sheets you can search help for “publish to web” or just “publish” usually works to navigate to the right place.

 

BUT for me the “Attach image by URL” is not working. I see the link is valid and shows my image but during testing no image comes through at all.

I have the same problem. The image is published nothing shows on slack.
@TimS any idea how to solve this issue? Thanks

Reply