Automate sending Discourse Topic to Facebook Fanpage with Zapier

Topic excerpts are not pulled into Zapier with the official Zapier Discourse integration. Excerpts are also not sent from Discourse if you connect a Discourse webhook to Zapier by adding it to a webhook trigger (details about setting that up are found here: https://meta.discourse.org/t/discourse-webhooks-and-zapier/56753.) You can create excerpts from the post’s raw content on Zapier though. Here’s how I set that up with the New Post in Discourse trigger:

First setup the New Post in Discourse trigger. Details about setting that up are here: Using the Zapier Discourse Zap Templates. When configured, the trigger step should look something like this:

Then add a Formatter by Zapier step. Choose the “Text” event. For the Transform option, select Truncate. Select the Raw content from your trigger step as the input and set the Max Length value to the number of characters you want to display in the post. When configured, the Text step should look something like this:

In the final Create Page Post in Facebook Pages action step, select the Raw value that is returned from the Text step:

Note that if you use either the official Discourse integration, or a Discourse webhook instead of using the RSS feed, the topic’s permalink will not be set for you. You can construct the permalink in the action step’s Link URL input from the topic slug and topic id that are passed from your initial trigger step:

Details about creating a permalink and also about adding a filter step are given in this topic: Using the Zapier Discourse Zap Templates. Details about how to truncate the raw post content are not given in that guide. It is useful information, so I will add it there.

The approach that I’ve outlined here will also work when connecting a Discourse webhook to Zapier with the Zapier webhook trigger.

2 Likes