Best answer

How to send a message to a custom, private channel in Slack?

  • 30 July 2020
  • 8 replies
  • 1033 views

Userlevel 2

I’m trying to create a Zap which sends a message from Airtable to a private Slack channel which will change depending on the person specified in the Airtable record.  This needs to be a private channel message and not a direct message, since each group will have 3 members.

 

I’m trying to set the channel name (example: “name-metrics”) as a custom value, as shown below:

This exactly matches my channel name, but I’m getting the following message when I try to test the action:

Any ideas what I’m missing? I tried adding # to the front of the channel name. I know channels have IDs, but would like to do this with the channel name if I can. Thank you!

icon

Best answer by nalanson 11 August 2020, 15:11

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

8 replies

Userlevel 7
Badge +7

Hi @nalanson,

Using the channel name like above should work, you don’t need the # or the channel-id.
One thing I am not sure about however, is the action you are using.

Are you sure you are using the Slack “Send message to private channel” one? 

 

Please let me know if this helps you, or if you need more assistance!

~Bjorn

Userlevel 2

Thanks, Bjorn! Yes, I can confirm I’m using the ‘Send Private Channel Message’ action -- still getting the same error message as above.  

 

I was able to manually select the channel from the list of available channels:

But if I try to manually type the channel name (nathan-metrics) or use the same string from my Airtable record, I get the same error message shown above. I’ll admit, I’m stumped!

Userlevel 7
Badge +7

That is very weird. I have replicated your setup but was unable to get the same error message.

Maybe the test doesn’t have valid data, did you try to run it live? Can you try to skip the test, enable the Zap workflow and run it? Or make sure you have data in airtable that could be used.
And what kind of format is that Slack field in Airtable?

Seems like just a small issue where you are forgetting something ;) 

Userlevel 2

Yeah, very strange! I’m sure it’s something silly, but I can’t think of what it might be for the life of me, haha.

 

The Slack field is a formula field, and I’ve tried formatting the result as both a string and an array with the same results.  Running the Zap live doesn’t work either, and I have data in the base which it can use. 

 

I’m stumped! Thanks for jumping in on this one -- it’s much appreciated.  I’m going to file a support ticket and see if Zapier has any ideas what might be going on here.

Hey Nalanson

I'm having exactly the same issue with custom values in the channel name field.

Did you already find a solution?

Userlevel 2

Hi Florian, I ended up having to use the Channel ID to get this to work -- using custom values wasn’t possible.

Hi Nalanson

Thank you for your quick reply!
Too bad! Using channel names as variables would have been too nice... :-)

Userlevel 1

I haven’t tried with channels, but I’ve gotten this working for direct messages by using the internal slack ID of the user.
For direct messages i go the user id by opening their profile, clicking on three dots and then copy member id.

Then in Zapier for who to send the message to, I chose Custom, and then populated that field with the member id I’d pasted earlier (which can be taken as a variable from another step).

I’d expect the same to work using the channel id. You can get the channel id by right clicking on the channel and choosing copy link. You’ll get a link like https://xxx.slack.com/archives/C01XXXXXXX

The channel id is after the last slash (eg C01XXXXXXX)