Sunday, February 14, 2016

Integrate Google Apps and Slack with Google Apps Scripts (Incoming Webhooks)

Google Apps and Slack are two the most popular productivity tools for unicorn startups (=early stage companies with valuation $1B+).  Almost 80% unicorn startups are using Google Apps as primary platform for email, calendar or storage and 50%  of them are using Slack for internal communication [source]

It means that nearly half of these cool startups could integrate their internal process with Google Apps Scripts.


Slack API has several possible ways how to integrate your application/script into their platform. Today we will start the simplest way - through Incoming Webhooks.  Webhooks are solid and unique published URL address, which allows you send any data, which will be saved into channels.




The small guide how to integrate Google Apps with Slack in 10 minutes

1) Visit link https://my.slack.com/services/new/incoming-webhook/. You will be redirected into settings page of your board.

2) Select the target channel (e.g #tech) - don't worry you can change afterwards. Next click at green button Add Incoming WebHooks integration. 


3)  The remain Slack webpage contains settings like name of the robot (=it's not actually pseudo-robot), icon, default channel and so on. We only need to copy webhook url. (e.g. https://hooks.slack.com/services/xxxxxx/xxxxxxx/xxxxxxxxxxxxxxxxxxxxxxxxxx

4) Create a new Google Apps Script project and copy code snippet. Insert your webhook url from previous


5) Now run START() function in Apps Script. If you insert right url, you will see a new message is relevant channel.

Now you have connect your Google Apps Script with Slack. You can simply load data from Calendar, Gmail, Drive or Sites and create alert on events. I will show you in some next article.

I recommend check tips how to format text, add links or attachments: https://api.slack.com/docs/formatting

Are planning to integrate your Google Apps with Slack? Let your ideas in comments section

Are you interested in this topic? Follow me on Twitter, Google+ or subscribe RSS

5 comments:

  1. Hi, please, i need a help. I have a Google Spreadsheet working with 2 coworkers, they fill how many sale have a day.

    But, what i want, is create a Slash Command in Slack for example /sales and show me the sales are so far.

    How can i do that? i mean send information from one column (the column sales) to slack?

    ReplyDelete
  2. When im run your script, say: Script function not found: myFunction Dismiss

    ReplyDelete
  3. Quel est notre produit? - La meilleure marque de luxe au monde regarde des kopie horloges de la plus haute qualité! Si vous voulez avoir ces Kopie Horloges IWC de luxe, vous voulez porter ces montres sur votre poignet, mais arrêtez-vous en raison de leur prix élevé. Alors s'il vous plaît arrêtez vos pas, c'est votre endroit le plus correct..

    ReplyDelete
  4. We offer you all world famous best replica watches, with same appearance, same quality and same material…you cannot tell which one is a replica omega seamaster just with your eyes at all!

    ReplyDelete
  5. Hiya, I am really glad I have found this info. Nowadays bloggers publish only about gossips and internet and this is really irritating. A good web site with exciting content, this is what I need. Thanks for keeping this website, I will be visiting it. Do you do newsletters? Can’t find it. Pakar SEO

    ReplyDelete