In Logic apps how to pass a single backslash (\) as string in another action?

Bharvi Bhut 181 Reputation points
2022-07-14T04:33:25.483+00:00

Hello there,

  • I am making an logic app which has one http request action.
  • Inside that http body I want to pass a variable which has a string with backslash
  • But when I tried every single backslash was transformed into two backslash
  • Can anyone has a solution for this?

Here I have attached an image of what I am passing in string VS. what the second action take that string as.
220588-screenshot-2022-07-14-095900.png

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,824 questions
Microsoft Sentinel
Microsoft Sentinel
A scalable, cloud-native solution for security information event management and security orchestration automated response. Previously known as Azure Sentinel.
969 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Clive Watson 5,711 Reputation points MVP
    2022-07-14T13:58:29.383+00:00

    Have you tried "\" two backslashes as that is often translated the other way to a single as its a special character

    0 comments No comments

  2. Kamlesh Kumar 3,861 Reputation points
    2022-07-15T06:45:57.917+00:00

    Hi @Bharvi Bhut ,

    Welcome to Microsoft Q&A Platform. Thank you for the question.

    When edited in design view, logic apps adds a backslash to the original backslash to cancel it out. If you go to Code view you can remove it manually.

    From:

    "inputs": "This is Test Data \\n And this is new line 1 \\n New line 2"  
    

    To:

    "inputs": "This is Test Data \n And this is new line 1 \n New line 2"  
    

    Regards,
    Kamlesh Kumar
    BizTalk Techie

    Please don't forget to click on 205836-130616-image.png or upvote 205759-130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is How

    Want a reminder to come back and check responses? Here is how to subscribe to a Notification

    If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

    0 comments No comments