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 / concat adding double q...
Power Automate
Unanswered

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

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

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard