How can I make the body of a message received in a channel in Teams (coming from another application by webhook) be mapped and understood as JSON by Power Automate so that I can use the variables individually along the flow
text sent as a message on the channel.
Name: AAAA
Login: BBB
email: CCCC
exemple
after converting to JSON I would like to be able to use each piece of information (name, login, email..) individually along the flow
Woowwww !!!!!
Tks! it works !!!!
I've created a sample flow that should get what you're after.
Assumptions:
Below is the full flow. I'll go into each of the actions.
The trigger is: When a new channel message is added, which I'm assuming you already have to pick up new messages.
Html to text removes all the HTML and just leaves the raw text and any new line characters. The input is the Message body content from the trigger.
The Filter array takes in an expression which is your Html to text output, split by new line. The expression is:
split(outputs('Html_to_text')?['body'], decodeUriComponent('%0A'))
Note that decodeUriComponent('%0A') represents a new line character.
The item represents each of the items in the array. For this we are testing to see if the item is NOT empty, which will end up removing all the empty lines from our initial output. The expression we use for item is:
item()
Finally, we use Parse JSON so we can get our fields available to use within the rest of the flow. For this we input a JSON object with the Name, Login and Email as our properties. And for the values we need to split each line by ": " then get just the value part (index 1).
The input for Name, Login and Email is using the following expressions:
split(body('Filter_array')[0], ': ')[1]
split(body('Filter_array')[1], ': ')[1]
split(body('Filter_array')[2], ': ')[1]
The JSON is:
{
"Name": @{split(body('Filter_array')[0], ': ')[1]},
"Login": @{split(body('Filter_array')[1], ': ')[1]},
"Email": @{split(body('Filter_array')[2], ': ')[1]}
}
And the schema to get our properties is:
{
"type": "object",
"properties": {
"Name": {
"type": "string"
},
"Login": {
"type": "string"
},
"Email": {
"type": "string"
}
}
}
You should now see the properties from Parse JSON that you can use.
You can trigger the flow on each new message in the channel.
With the split expression you can cut out the individual parts of the message that you need in compose actions and then do with them what you need to do.
You'll have to fiddle with it a bit, but you'll get it to work that way eventually.
stampcoin
101
Michael E. Gernaey
82
Super User 2025 Season 1
David_MA
48
Super User 2025 Season 1