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 / Parse XML with Microso...
Power Automate
Unanswered

Parse XML with Microsoft Flow

(1) ShareShare
ReportReport
Posted on by 4

Hello,

I have an xml file, and I'm able to read it on Add Contact step with the following: 

 

xpath(item(),'string(contact/firstName)')

 

however, I can't figure it out how I can use the same read inside another for each loop when I'm trying to update existing contact (see below marked in red). 

Could somebody help me to solve this issue? when I run the flow and if there is an update the flow failing with the following message: 

'The template language function 'xpath' expects its first parameter to be an XML object. The provided value is of type 'Object'

 

Capture.PNG

Categories:
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @user_01T1 

     

    1. It might need an inner expression function "xml" to convert it to XML before using xpath, like this:

     

     

    xpath(xml(item()),'string(contact/firstName)')

     

     

    2. if the above doesn't work, try checking on

     

    item()

     

    in a dummy Compose Action to see what is the value.

    If it is not looking like valid XML to you, that is the reason.

    If you see an issue, try to make it look like valid XML, and then also try #1 as well (since the best you may be able to do is get it to a string that could be converted to valid xml)

     

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 159

Last 30 days Overall leaderboard