web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Custom message to team...
Power Automate
Unanswered

Custom message to teams channel via Power Automate

(3) ShareShare
ReportReport
Posted on by 16
Via a powershell script, I'm trying to send a message to a power automate flow which should send it to a teams channel.
 
This currently send an empty message to the teams channel. Ideally it says 'Hello World - Plain Text Test'.
 
 
The PS script looks like this:
$WebhookUri = "https://prod-00.uksouth.logic.azure.com:443/workflows/xxxxxxxxxxxxxx/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=xxxxxxxxx"
$Payload = @{
    type = "message"
    content = "Hello World - Plain Text Test"
}
$JsonPayload = $Payload | ConvertTo-Json -Depth 10
Invoke-RestMethod -Method Post -Uri $WebhookUri -ContentType "application/json" -Body $JsonPayload
 
The Power Automate flow looks like this:
 
 
 

The input for the trigger is:
 
{
    "schema": {
        "type": "object",
        "properties": {
            "type": {
                "type": "string"
            },
            "attachments": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "contentType": {
                            "type": "string"
                        },
                        "content": {
                            "type": "object",
                            "properties": {
                                "$schema": {
                                    "type": "string"
                                },
                                "type": {
                                    "type": "string"
                                },
                                "version": {
                                    "type": "string"
                                },
                                "body": {
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "type": {
                                                "type": "string"
                                            }
                                        },
                                        "required": [
                                            "type"
                                        ]
                                    }
                                }
                            }
                        }
                    },
                    "required": [
                        "contentType",
                        "content"
                    ]
                }
            }
        }
    }
}
 
The outputs are:
{
    "headers": {
        "Host": "prod-00.uksouth.logic.azure.com",
        "Max-Forwards": "10",
        "User-Agent": "Mozilla/5.0,(Windows NT; Windows NT 10.0; en-GB),WindowsPowerShell/5.1.22621.3880",
        "X-ARR-LOG-ID": "xxxxxxxx",
        "CLIENT-IP": "xxxxxxxx",
        "DISGUISED-HOST": "prod-00.uksouth.logic.azure.com",
        "X-SITE-DEPLOYMENT-ID": "xxxxxxxx",
        "WAS-DEFAULT-HOSTNAME": "xxxxxxxx",
        "X-Forwarded-Proto": "https",
        "X-AppService-Proto": "https",
        "X-ARR-SSL": "xxxxxxxx",
        "X-Forwarded-TlsVersion": "1.2",
        "X-Forwarded-For": "xxxxxxxx",
        "X-Original-URL": "/workflows/xxxxxxxx/triggers/manual/paths/invoke?api-version=xxxx",
        "X-WAWS-Unencoded-URL": "/workflows/xxxxxxxx/triggers/manual/paths/invoke?api-version=xxxx",
        "Content-Length": "78",
        "Content-Type": "application/json"
    },
    "body": {
        "content": "Hello World - Plain Text Test",
        "type": "message"
    }
}
 
The parameters in the Send action are:
 
The Flow isn't saying anything fails : 
Your flow ran successfully.
 
Any advice how I can get that custom message to appear in the teams channel would be greatly appreciated!
Categories:
I have the same question (0)
  • Verified answer
    Expiscornovus Profile Picture
    33,189 Most Valuable Professional on at
    Can you try the below expression in your Body field?
    triggerOutputs()?['Body']['content']

    Below is the test result



    ​​​​​​​

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard