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

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Parsing XML CData

(0) ShareShare
ReportReport
Posted on by 28

I have a flow where I make an HTTP request for xml data. I'm using xpath to parse it but it's not handling CDATA properly. It's showing me <![CDATA[California]]> as the output instead of just California. 

 

This is my input: xpath(xml(item()),'string(/Dinger/StateName)')

 

Everything is right in my outputs for all elements except this. Is there something I can do differently in my xpath expressions for the elements with CDATA? If not, how do I handle transformation in Flow to remove the text and characters that I don't want?  

I have the same question (0)
  • Jcook Profile Picture
    7,779 Most Valuable Professional on at
    Re: Parsing XML CData

    Hi @joshlwulf 

     

    Could you provide an example/sample output from the http request?

  • Verified answer
    v-litu-msft Profile Picture
    on at
    Re: Parsing XML CData

    Hi @joshlwulf,

     

    There is no direct function could process the CDATA part in the XML file.

    The only way in my mind is using the replace() function to remove these characters:

    replace(replace(outputs('Compose'),'<[CDATA[',''),']]>','')

    Annotation 2020-05-14 105543.jpg

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 691 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 431 Moderator

#3
developerAJ Profile Picture

developerAJ 266

Last 30 days Overall leaderboard