web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / concat adding double q...
Power Automate
Answered

concat adding double quotes is adding backslash that makes xpath statement invalid

(0) ShareShare
ReportReport
Posted on by 9

when item()[]ParentPosition] is 1.1 below works:

 

 

xpath(outputs('Compose-XML'),concat('//array[Item = ',item()['ParentPosition'],']/PartNumber/text()'))?[0]

 

 

when item()[]ParentPosition] is is 1.1.1 it does not. I think 1.1.1 requires ". e.g "1.1.1"

Tried below:

 

 

concat('//array[Item/text() = ','"', item()['ParentPosition'] ,'"', ']/PartNumber/text()')

 

 

returns

 

 

//array[Item/text() = \"1.1.1\"]/PartNumber/text()

 

 

how do I remove the \  from \"1.1.1\" so that I have "1.1.1".

wrapping with replace does not work e.g. replace( above, '\','') 

Categories:
I have the same question (0)
  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at

    Are you able to provide some of the initial JSON or XML you are working with? What you are storing in:

     

    outputs('Compose-XML')

     

    I think it will always show \" as it needs to escape the double quotes. You can try the following instead to give you single quotes.

     

    concat('//array[Item/text() = ''', item()['ParentPosition'] , ''']/PartNumber/text()')

     

  • Wendy_Lumsden Profile Picture
    58 on at

    Hi @PaulHancock  - did you resolve this issue?

     

    I am have exactly the same problem, since I am querying an xml with a string id .... which needs double inverted comma's and keep getting errors because power automate adds a backslash before the inverted comma's, which I also tried to remove with replace.... to no avail.

    Any help much appreciated.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 476

#2
Haque Profile Picture

Haque 424

#3
David_MA Profile Picture

David_MA 350 Super User 2026 Season 1

Last 30 days Overall leaderboard