Adding field names to Slack integration
Asked by Dominic Young:

Hello All

I think I am probably being stupid, so apologies in advance for that. I am trying to create a rule in Trello which automatically posts to a Slack channel when things happen, like a new card being created. Setting the trigger for this is easy and it works, but I want to add fields like {cardname} into the command so the Slack message can contain it. However, I can't see a way to do this because the Butler treats any text added in the message text field as text, doesn't recognise the curly quotes as referring to a field. I can't see any way to alter the command other than via the wizard-style editor (i.e. I can't see how to edit the text of the command which the editor generates).

I'm using a free tier of Trello so maybe it's a limitation of that, but if anyone could point me in the right direction I'd be really grateful.


Answers:
author: Dan Ivory
body: Hey [@Dominic Young](/t5/user/viewprofilepage/user-id/4469616)

These tutorial videos might help with setting up Butler to post messages. These are slightly different use cases for Butler and Slack but the message part is the same and should show you how to set them up so it posts correctly in Slack based on the [variables.](https://help.trello.com/article/1157-variables)

<https://youtu.be/H7gMmeTCIOI?t=375>

<https://youtu.be/i8Ahr-oUgN4?t=258>

(I've started them at the point where I start setting up the Slack message part, but feel free to watch from the beginning for more details)

Hope that helps! Feel free to send us a screenshot of your set-up if you want more help so we can see how it looks for you.

Cheers,

Dan

comments: author: Dominic Young
body: Great, thanks, I'll check them out!

Dominic


author: Dominic Young
body: Thanks all for your help. Embarrassingly enough the problem came down to fat-fingers. But I learned a lot!

Dominic


author: Raegan Fordemwalt
body: Hey, I use notifications in slack all the time, and using variables work fine in them for me. This is an example of one I have that works. Is this what you're doing, too?

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/150618i3DDE61DCD46F3DDA/image-size/large?v=v2&px=999 "image.png")

comments: author: Dominic Young
body: I think the problem is I can't see how to directly edit that text, I can only access a sort of visual wizard tool...


author: milynnus
body: [@Dominic Young](/t5/user/viewprofilepage/user-id/4469616)

Thanks for your post. It gets me thinking about text merge capability. I will update when I come up with something.

**Update :**

I submit that if there is an easier way you should use it. (See my additional reply below - tested using {variable} in slack message and it works....**so below is quite redundant for this specific purpose.**

I created a module which will be called using Butler Http Request which will replace any text by looking for a match key-value pair in the payload and replace string with the value found.

Here's an example

{"text" : "The values of %cardidlong% and %cardname% should appear in the returned text in {httprepsonse.text}", "%cardidlong%" : "{cardidlong}", "%cardname%" : "{cardname}"}

You will use {httpresponse.text} in your Slack Message.

comments: author: Dominic Young
body: thanks!

I have a lot to learn..!


author: milynnus
body: [@Dominic Young](/t5/user/viewprofilepage/user-id/4469616)

I had this simple test card command
> post message "This is the card id from which this message is triggered : {cardidlong}" to Slack channel "#trello_slack" in workspace "Workspace" as myself

and the value is sent.

So I agree with [@Raegan Fordemwalt](/t5/user/viewprofilepage/user-id/3885381)


Tags: butler

slack