Hi everyone,
I'm trying to replace newline characters in a string coming from an Adaptive Card payload submission, but my `replace()` formula doesn't seem to be doing anything.
---
My formula:
```
replace(replace(coalesce(body('Parse_additional_details_card_payload')?['audienceProfile'], ''), '\r\n', '<br>'), '\n', '<br>')
```
Example payload received from the card:
```json
{
"body": {
"action": "submitModify",
"actionSubmitId": "Submit",
"audienceProfile": "course\n\ndescription\n\n\ntest",
"comments": "course\n\ndescription\n\n\ntest",
"courseDescription": "course\n\ndescription\n\n\ntest"
}
}
```
The `audienceProfile` value clearly contains `\n` characters (visible in the raw JSON), but after the formula runs, the output string still contains the literal newlines — the `<br>` tags are not being inserted.
What I've tried:
- Replacing `'\n'` (escaped)
- Replacing `'\r\n'` (for Windows-style line endings)
None of these have worked so far.
My question:
How do I correctly match and replace actual newline characters (coming from an Adaptive Card submission) inside a Power Automate expression? Is there a special way to represent a literal newline in the `replace()` function?
Any help is appreciated — thanks in advance!