Skip to content

Advanced Custom Fields Automations

How to Post a Slack Message When an ACF Field Is Updated on a Post

Some changes are better seen in a team channel than in an inbox — a project status, an event capacity, a stock level. Zapify can post to Slack when an ACF field changes on a post, using the A field is updated on a post trigger and the Send a Slack message action. Both are Zapify PRO.

What this automation does

The automation is one trigger plus one action:

  • Trigger: A field is updated on a post (ACF_POST_FIELD_UPDATED, Advanced Custom Fields)
  • Action: Send a Slack message (SLACK_SEND_MESSAGE, Slack)

When the field you chose changes on a post, Zapify posts a message to the Slack channel you pick.

Before you start

  • Advanced Custom Fields installed and active, with a field group on the post type you want to watch.
  • A Slack app for your workspace with a bot user OAuth token (starts xoxb-) that has the chat:write scope — see Slack's authentication basics.
  • The bot invited into the channel it should post to. Slack will not let it post to a channel it is not a member of.

How to build the automation

Step 1: Connect Slack

  1. Go to Settings → Connections and click Add New.

Open the Connections tab

  1. Choose Slack, paste in the bot user OAuth token, and name the connection something like Team Slack.

Complete the Slack connection

  1. Save.

See Connections for how this screen works generally.

Step 2: Create a new automation

  1. In the WordPress admin, go to Zapify → Automations.
  2. Click Add New to open the builder.
  3. Name it clearly, such as Announce ACF changes in Slack.

Create a new automation

Step 3: Add the "A field is updated on a post" trigger

  1. Click Add Trigger.

Add a trigger

  1. Choose Advanced Custom Fields as the app.

Select Advanced Custom Fields as the trigger

  1. Select A field is updated on a post.

Select A field is updated on a post

  1. Pick the Post type and the Field to watch. To announce only one outcome, such as a status of Published, fill in Only when the new value is.

Step 4: Add the "Send a Slack message" action

  1. Click Add Action.

Add an action

  1. Choose Slack as the app.

Select Slack as the action

  1. Select Send a Slack message.

Select Send a Slack message

Step 5: Configure the action

Field Required What it does
Connection Yes The Slack connection from Step 1.
Channel Yes A channel name such as #projects or its ID. The bot must already be a member.
Message Yes The text to post. Insert the trigger's tokens.

For example:

  • Channel: #projects
  • Message: {{trigger:POST_TITLE}}: {{trigger:FIELD_LABEL}} is now {{trigger:NEW_VALUE}} (was {{trigger:OLD_VALUE}}) {{trigger:POST_URL}}

Step 6: Set the steps Live and save

Each trigger and action has its own Live / Off / Draft switch. A new automation starts as a Draft and does nothing until its steps are Live.

  1. Set the trigger and every action to Live.
  2. Click Save.

Set the automation live

Step 7: Test it

Change the field on a test post and click Update. Check the Slack channel, or open Zapify → Logs — a failed post shows Slack's own error code, such as channel_not_found or not_in_channel.

Tokens you can use

The A field is updated on a post trigger exposes Post ID, Post title, Post type, Post URL, Post author ID, Field label, Field name, Field key, Field type, New value (formatted), New value (as stored) and Old value. See sending an email when an ACF field is updated on a post for what each one holds.

Conclusion

With the A field is updated on a post trigger and the Send a Slack message action, a custom-field change becomes a message the whole team sees. For other Slack ideas, see posting a Slack message when a product is purchased.

FAQs

Is this free in Zapify?

No. The ACF trigger and the Slack action are both part of Zapify PRO, and Slack needs a Connection.

Why did the message not arrive?

Open Zapify → Logs. not_in_channel means the bot has not been invited to the channel, and channel_not_found means the name or ID is wrong.

Can I post only when the field gets a specific value?

Yes. Fill in Only when the new value is on the trigger.

Does one save post several messages?

One message per changed field that matches. Pick one Field if you want a single message.

Do I need to write any code?

No. The connection and every field are configured visually.

Was this page helpful?