Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Post Slack message as an attachment

(0) ShareShare
ReportReport
Posted on by 9

I am using a flow which simply posts a message to slack.

 

However I am wanting to post as an attachment which allows me to change the layout of the message and especially the color of verticle bar to be either danger, warning or good.

 

Is there a particular message format and parse option I need to select to be able to use attachments.

 

The info from the api documents says to use:

 

Test

{
 "attachments": [
 {
 "fallback": "Required plain-text summary of the attachment.",
 "color": "#2eb886",
 "pretext": "Optional text that appears above the attachment block",
 "author_name": "Bobby Tables",
 "author_link": "http://flickr.com/bobby/",
 "author_icon": "http://flickr.com/icons/bobby.jpg",
 "title": "Slack API Documentation",
 "title_link": "https://api.slack.com/",
 "text": "Optional text that appears within the attachment",
 "fields": [
 {
 "title": "Priority",
 "value": "High",
 "short": false
 }
 ],
 "image_url": "http://my-website.com/path/to/image.jpg",
 "thumb_url": "http://example.com/path/to/thumb.png",
 "footer": "Slack API",
 "footer_icon": "https://platform.slack-edge.com/img/default_application_icon.png",
 "ts": 123456789
 }
 ]
}
  • Community Power Platform Member Profile Picture
    on at
    Re: Post Slack message as an attachment

    Hello -

     

    There is actually a fix or work around for Slack to receive attachments for messages as you seek but not from the Slack action option but using the 'HTTP' action instead. This would involve in setting up a slack bot within your workspace in Slack and creating a incoming webhook for this Slack bot to the designated slack channel you desire. Here's a break down:

     

    1. Once your created a blank Flow template, search for 'HTTP Request' as the trigger:

    2. Configure the 'HTTP Request' as you need with a custom JSON payload but ensure the method is set as a 'POST'. You will be provided a URL which will be plugged into your 3rd party application example, New Relic or some type of Logic App.

    3. Next, add an action by searching for 'Control' conditioner.

    4. Configure as you see fit following the results from the incoming HTTP request.

    5. The control conditioner gives you an 'if yes' or 'if no' options... Configure both by searching for another action named 'HTTP'. The method remains the same as 'POST' and input any custom header information you may have if needed. The URI will be your incoming webhook URL from your Slack bot in your workspace. The body option is where you would input your custom Slack message to be displayed in Slack. Also, authentication and value are set per security settings within your workspace. But normally, default is usually 'raw' with value defined as 'application/json'.

     

    I've also ran into a snag with the HTTP Request URL output as its encoded and my 3rd party application service could not recognize it so I had to decode the URL from Flow and once I did that, things started rolling from there.

     

    Hope this helps.

  • Community Power Platform Member Profile Picture
    on at
    Re: Post Slack message as an attachment

    Hello -

     

    There is actually a fix or work around for Slack to receive attachments for messages as you seek but not from the Slack action option but using the 'HTTP' action instead. This would involve in setting up a slack bot within your workspace in Slack and creating a incoming webhook for this Slack bot to the designated slack channel you desire. Here's a break down:

     

    1. Once your created a blank Flow template, search for 'HTTP Request' as the trigger:

    2. Configure the 'HTTP Request' as you need with a custom JSON payload but ensure the method is set as a 'POST'. You will be provided a URL which will be plugged into your 3rd party application example, New Relic or some type of Logic App.

    3. Next, add an action by searching for 'Control' conditioner.

    4. Configure as you see fit following the results from the incoming HTTP request.

    5. The control conditioner gives you an 'if yes' or 'if no' options... Configure both by searching for another action named 'HTTP'. The method remains the same as 'POST' and input any custom header information you may have if needed. The URI will be your incoming webhook URL from your Slack bot in your workspace. The body option is where you would input your custom Slack message to be displayed in Slack. Also, authentication and value are set per security settings within your workspace. But normally, default is usually 'raw' with value defined as 'application/json'.

     

    I've also ran into a snag with the HTTP Request URL output as its encoded and my 3rd party application service could not recognize it so I had to decode the URL from Flow and once I did that, things started rolling from there.

     

    Hope this helps.

  • GabrielStJohn Profile Picture
    on at
    Re: Post Slack message as an attachment

    Hello, @JaseC!

    Thank you for posting on the Flow Community Forum! If you have already posted your idea to the Flow Community Ideas Forum or found an existing idea to upvote, then you need to post the URL to the idea’s thread as a reply to this thread. Then click "Accept as Solution" on the reply if you approve it as a solution to your issue so that other users may vote for the Flow Idea and identify the information easily within this thread.

    Thank You for being an active member of the Flow Community!

    -Gabriel
    Flow Community Manager

  • Verified answer
    v-yuazh-msft Profile Picture
    on at
    Re: Post Slack message as an attachment

    Hi @JaseC,

     

    The function to post Slack message as an attachment is not supported in microsoft flow currently.

    I afraid that there is no way to achieve your needs in Microsoft Flow currently.

     

    If you would like this feature to be added in Microsoft Flow, please submit an idea to Flow Ideas Forum:

    https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

     

    Best regards,

    Alice

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow