Automatic Slack Notifications for Podio Events via Globiflow
While the title of this page might sound daunting, connecting Podio to Slack for simple notifications / message on Podio events (new project, new comments, etc.) is actually really simple with Globiflow and integrates really well into any existing flows you might already have set up.
Here is how you can get Podio to talk to Slack (using Globiflow):
- If you haven’t already, set up a webhook in your slack online settings portal.
- If you are creating a brand new one, go to: https://my.slack.com/services/new/incoming-webhook/
- If you are trying to modify or find an existing one, go to https://slack.com/apps/A0F7XDUAZ-incoming-webhooks
- You don’t need to customize your webhook at all, but you do need to grab the “Webhook URL” from the setup page – this is the address that Globiflow will send data to in order to post to Slack.
- Go to Globiflow (I would recommend doing this in another tab, so you can switch back to editing your Slack webhook if desired).
- If you use Podio significantly and are not using Globiflow, you are missing out on some seriously awesome automation that can make your life a lot easier. Globiflow has a huge feature list, supports using PHP in calculations, and is included for free if you are using Podio Premium.
- Decide how/when you want the slack notification to be triggered – the webhook can exist in any flow and does not require a specific flow trigger type – so you basically have the full power of Globiflow to structure how your notification is generated. See the bottom of this post for sample ideas.
- Add a step to your flow – select the action type “Remote POST / GET”
- The “From URL” should be the “Webhook URL” from Slack. Make sure you copy and paste it exactly from Slack.
- In the dropdown at the top, have “POST” selected
- “POST Params” is what should contain the JSON payload that Slack interprets and presents as a message in Slack. If you are having trouble figuring out how to format your Slack JSON payload, I built a tool to make it easier to experiment with Slack message formatting and also test webhook URLs – check it out here!
- You can combine Globiflow variables (the blue boxes in my screenshot) with plain text. Keep in mind quotes have to be either be escaped, or make sure your inner most enclosing quotes are single while outside are double (or reversed).
- Since this field is basically a PHP calc field, you need to either properly escape a stringified JSON object (as seen in my sample far below) or use something like json_encode(PUT_ARRAY_HERE). (Thanks Raphael for the reminder! See his example in the comments)
- You also need to hit the “(OPT)” link at the top to expand the header section and paste in “Content-Type:application/json” (see screenshot below for example).
6. Save your flow, and optionally test it first on a sample item by clicking the “simulate vars” link at the bottom.
Sample:
Here is a screenshot showing a Globiflow flow I have set up to notify our team on Slack for every 100 projects that get added into our CL workspace. I considered doing it when projects are complete, but I realized that since projects are often completed out of order, that could mess up my math for triggering on every 100.
More Examples:
Here are some more examples of how you could utilize Podio sending Slack notifications through Globiflow:
- Keep track of a “backlog”, e.g. unfinished projects. When it reaches a certain level, send a slack notification to an operations channel to alert them.
- Make a Podio user for automation stuff – give it a username of “PodioBot”. Then make a flow that sends any comment @PodioBot through a slack notification. So in Podio, someone could comment on a project “@PodioBot For discussion in today’s meeting”.
- Make a flow to gather basic stats (# of finished projects, # of in progress, etc.) and then post daily summary message to Slack.
- Have a button on projects that functions as a “help needed” button, almost like a ticketing system. Have a flow that triggers on this button getting pressed and notifies support with a link to the project. When support fixes the issue, they can unclick the button.
We use Slack, but we are anything but slackers. Check out how we can help you stay on top of your marketing game – Click here.
Many thanks for your tutorial; but we can’t use it. Doesn’t work (error 400).
Could you give us the correct syntax? Maybe Slack updated it.
Many thanks!!!
Can you please clarify what is giving you the 400 Error? Is that the response from Slack when POST’ing to your created webhook? Screenshots would be helpful.
We have a flow that actually just triggered today successfully with this same code, so it seems unlikely that something has changed.
I would check your JSON syntax first, since that is the most likely culprit. You can try validating it here: https://api.slack.com/docs/messages/builder
Many Thanks Joshua,
Always I have the same “Error: HTTP Returned Code 400”
I have tried the following ways:
Capture Result of a Remote POST or GET
POST
From URL (webhook URL works with your tool)
POST Params: ‘{“text”:”Hello\n”}’
and without ‘ ‘ quotes:
POST Params: {“text”:”Hello\n”}
Nothing works 🙁
Many thanks again.
Now works! Only put in header: Content-type: application/json
Many thanks!!!
😀
Having the same problem. Where did you add the header?
Hi Paul,
You have to click the little “(OPT)” link to expand the header section. I have updated this post to reflect the correct instructions.
Hi Joshua,
I am pretty sure everything is correct… I am getting a “Error: HTTP Returned Code 400” error each time.
1. Header (Opt): Content-type: application/json
2. Variable Name: “slack_webhook_01” and value set to “Post”
3. Generated new token from Incoming Webhooks webpage “https://hooks.slack.com/services/x/x/x
4. Post Params:
{
“text”: “This is a line of text.\nAnd this is another one.”
}
(I chose an easy text string)
I cannot get it to work 🙁
The JSON param I want to send is:
{
“text”: “New Project Deliverable Status:”,
“attachments”: [
{
“text”: “[(deliverable) Project]: [(deliverable) Deliverable] \nStatus has been changed to [(deliverable) Status].”
}
]
}
Any thoughts???
BR
Stuart
Helpful but incomplete. Before creating the POST action, you need to configure a “Create Variable” action, call it “Slack_json” (for instance) and make it equal to :
json_encode([
'text' => 'your text here',
'channel' => '#YourSlackChannelHere'
])
It won’t work otherwise. Hope this helps.
Thanks! I actually had an example screenshot in my original post (that got deleted for some reason) that showed an alternative approach of using a string literal of the JSON. Although I think your approach is cleaner and avoids messy escaping. I have updated the post to match.