Adding line breaks back into Teams Adaptive Cards Input.Text

Photo of author

Dan Rios

1 min read

When using Teams ‘Post adaptive card and wait for a response’ in PowerAutomate/LogicApps with a text box in the card, you may find the line break does not translate to an email as expected. For example:

Workaround

  1. Initialise a variable to the logic as a string type. In the value hit return to create a line break

2. Add a data compose action and select the dynamic context for the text box id

3. Add another data compose action and enter the following in the expression context making sure it matches your variable name from earlier

replace(outputs('compose'), variables('break'),'<br>')

4. Add the data compose into the email body to get the response text with line breaks

Line breaks show as they were typed from the card in the email alert.

That’s it!

PowerAutomate example

Leave a comment


Skip to content