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 / Adaptive Card fails to...
Power Automate
Suggested Answer

Adaptive Card fails to process attachment when text includes backslashes

(1) ShareShare
ReportReport
Posted on by 73
It seems like my flows fail when the user includes the character "\" in the text field of the TextBlock of my Adaptive card. I included a function in an attempt to replace backslashes. 
    {
      "type": "TextBlock",
      "text": "@{replace(replace(triggerOutputs()?['body/bcappdev_description'], '"', '\"'), '\\', '\\\\')}",
      "wrap": true
    },
 
 
But it does not appear to work properly. Has anyone ever encountered this error/issue? Any suggestions would be great.
 
I have attached the error message I get when the flow fails. In this particular failed flow, the user submitted a long string of text in the text block with a number of folder paths and strings including multiple backslashes.
 
 
EDIT: I should add the the end user is the one submitting input to the Text field, so I can't really stop them from submitting backslashes. I need a function to replace them.
Categories:
I have the same question (0)
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Hi,
     
    if there is backward slash, replace with \\ , something like below
     
    {
        "type": "AdaptiveCard",
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.3",
        "body": [
            {
                "type": "ColumnSet",
                "columns": [
                    {
                        "type": "Column",
                        "width": "stretch",
                        "items": [
                            {
                                "type": "TextBlock",
                                "text": "Path",
                                "wrap": true
                            }
                        ]
                    },
                    {
                        "type": "Column",
                        "width": "stretch",
                        "items": [
                            {
                                "type": "TextBlock",
                                "text": "C:\\Temp\\data",
                                "wrap": true
                            }
                        ]
                    }
                ]
            }
        ]
    }
    
     
    This can help !
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     
  • BillyBreathes Profile Picture
    73 on at
    Unfortunately, the end users are submitting the text in this case, so they do not know to use "\\" and instead it is up to me as the developer to figure out a way to deal with the "\"
  • Suggested answer
    Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Hi,
     
    Option would be to accept the user input data in single \, and make the power automate flow to replace \ with \\ and insert in adaptive card textblock.
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

     
  • BillyBreathes Profile Picture
    73 on at
    Yes, I do have a replace statement in my Adaptive card text block. It looks like this:

    @{replace(replace(triggerOutputs()?['body/bcappdev_description'], '"', '\"'), '\\', '\\\\')}
     
    But I cannot figure out why it is still giving me errors.
  • Nived_Nambiar Profile Picture
    18,129 Super User 2025 Season 2 on at
    Hi,
     
    i could not see the error message properly in screenshot Appdev_Error.png
     
    But if i am right- should you use this expression for replacing \ with \\ ?
     
    replace(triggerOutputs()?['body/bcappdev_description'], '\', '\\')
     
    Thanks & Regards,
    Nived N 
    LinkedIn: Nived N's LinkedIn
    YouTube: Nived N's YouTube Channel
    Blog: Nived Nambiar's Blogs
     Found my answer helpful? Please consider marking it as the solution!
     Your appreciation keeps me motivated. Thank you!

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 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard