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 Automate
Answered

XML parsing troubles

(0) ShareShare
ReportReport
Posted on by 782

End-goal

To bring in old InfoPath information through Flow, into our new system in our CDS. Ideally I could target the .xml files in the Forms library directly, but I think I have to resort to moving the files to a normal Document Library and then running the flow on there.

 

Scenario

1 XML Forms Library

1 Document Library

InfoPath forms in .xml files

 

Current Flow
Get Files(Properties Only) - To get the file names

To Each

Get file content - To get the actual XML inside the .xml file

Compose_XML - to get an idea of the XML structure(shown at the bottom of the post)

@{body('Get_file_content')}

Compose_replace - to run a replace on the xmlns: replace(outputs('Compose_xml'), 'xmlns=','')  (I don't know if this is needed or not)

@{replace(outputs('Compose_XML'), 'xmlns=','')}


Compose_xpath - to attempt to do an xpath function: xpath(xml(body('Compose_replace')), 'string(/my:myFields/my:Project)')

@{xpath(xml(outputs('Compose_replace')), 'string(/my:myFields/my:Project)')}

 

Error

InvalidTemplate. Unable to process template language expressions in action 'Compose_xpath' inputs at line '1' and column '2244': 'The template language function 'xpath' parameters are invalid: the 'xpath' parameter must be a supported, well formed XPath expression. Please see https://aka.ms/logicexpressions#xpath for usage details.'.

 

XML File

 

 

<?xml version="1.0" encoding="utf-8"?>
<?mso-infoPathSolution name="urn:schemas-microsoft-com:office:infopath:Capital-Time-Form:-myXSD-2016-09-16T14-34-41" solutionVersion="1.0.0.196" productVersion="16.0.0.0" PIVersion="1.0.0.0" href="https://addresshere.com"?>
<?mso-application progid="InfoPath.Document" versionProgid="InfoPath.Document.4"?>
<my:myFields xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dfs="http://schemas.microsoft.com/office/infopath/2003/dataFormSolution" xmlns:tns="http://microsoft.com/webservices/SharePointPortalServer/UserProfileService" xmlns:s1="http://microsoft.com/wsdl/types/" xmlns:pc="http://schemas.microsoft.com/office/infopath/2007/PartnerControls" xmlns:ma="http://schemas.microsoft.com/office/2009/metadata/properties/metaAttributes" xmlns:d="http://schemas.microsoft.com/office/infopath/2009/WSSList/dataFields" xmlns:q="http://schemas.microsoft.com/office/infopath/2009/WSSList/queryFields" xmlns:dms="http://schemas.microsoft.com/office/2009/documentManagement/types" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2016-09-16T14:34:41" xmlns:xd="http://schemas.microsoft.com/office/infopath/2003" xml:lang="en-US">
	<my:EmployeeName>Jim McJimmerson</my:EmployeeName>
	<my:Project>Big Project</my:Project>
	<my:ProjectFilter>All Projects</my:ProjectFilter>
	<my:Month>August</my:Month>
	<my:DevSetupWeek1>1</my:DevSetupWeek1>
	<my:DevSetupWeek2>1</my:DevSetupWeek2>
	<my:DevSetupWeek3>1</my:DevSetupWeek3>
	<my:DevSetupWeek4>1</my:DevSetupWeek4>
	<my:DevSetupWeek5>1</my:DevSetupWeek5>
	<my:ImplementTestWeek1></my:ImplementTestWeek1>
	<my:ImplementTestWeek2></my:ImplementTestWeek2>
	<my:ImplementTestWeek3></my:ImplementTestWeek3>
	<my:ImplementTestWeek4></my:ImplementTestWeek4>
	<my:ImplementTestWeek5></my:ImplementTestWeek5>
	<my:PlanningPMWeek1></my:PlanningPMWeek1>
	<my:PlanningPMWeek2></my:PlanningPMWeek2>
	<my:PlanningPMWeek3></my:PlanningPMWeek3>
	<my:PlanningPMWeek4></my:PlanningPMWeek4>
	<my:PlanningPMWeek5></my:PlanningPMWeek5>
	<my:DataConvWeek1></my:DataConvWeek1>
	<my:DataConvWeek2></my:DataConvWeek2>
	<my:DataConvWeek3></my:DataConvWeek3>
	<my:DataConvWeek4></my:DataConvWeek4>
	<my:DataConvWeek5></my:DataConvWeek5>
	<my:TrainingWeek1></my:TrainingWeek1>
	<my:TrainingWeek2></my:TrainingWeek2>
	<my:TrainingWeek3></my:TrainingWeek3>
	<my:TrainingWeek4></my:TrainingWeek4>
	<my:TrainingWeek5></my:TrainingWeek5>
	<my:AccCreationWeek1></my:AccCreationWeek1>
	<my:AccCreationWeek2></my:AccCreationWeek2>
	<my:AccCreationWeek3></my:AccCreationWeek3>
	<my:AccCreationWeek4></my:AccCreationWeek4>
	<my:AccCreationWeek5></my:AccCreationWeek5>
	<my:NetworkTelecomWeek1></my:NetworkTelecomWeek1>
	<my:NetworkTelecomWeek2></my:NetworkTelecomWeek2>
	<my:NetworkTelecomWeek3></my:NetworkTelecomWeek3>
	<my:NetworkTelecomWeek4></my:NetworkTelecomWeek4>
	<my:NetworkTelecomWeek5></my:NetworkTelecomWeek5>
	<my:PCSetupInstallWeek1></my:PCSetupInstallWeek1>
	<my:PCSetupInstallWeek2></my:PCSetupInstallWeek2>
	<my:PCSetupInstallWeek3></my:PCSetupInstallWeek3>
	<my:PCSetupInstallWeek4></my:PCSetupInstallWeek4>
	<my:PCSetupInstallWeek5></my:PCSetupInstallWeek5>
	<my:TotalCapHours>5</my:TotalCapHours>
	<my:TotalNonCapHours>0</my:TotalNonCapHours>
	<my:MonthValue>7</my:MonthValue>
	<my:Title>Jim_Big_Project</my:Title>
	<my:Year>2017</my:Year>
	<my:Submitted>true</my:Submitted>
	<my:ProjectTitle>Big Project</my:ProjectTitle>
	<my:Contractor>false</my:Contractor>
</my:myFields>

 

 

 

Categories:
I have the same question (0)
  • v-alzhan-msft Profile Picture
    Microsoft Employee on at

    Hi @notj ,

     

    I'm afraid that your requirement couldn't be achieved since the "Get file content" action couldn't get the data in the file.

     

    Best regards,

    Alice       

     

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

  • Verified answer
    Jcook Profile Picture
    7,783 Most Valuable Professional on at

    Hello @notj 

     

    Check out my Solution on this post:

    https://powerusers.microsoft.com/t5/Building-Flows/Reading-xml-file-from-onedrive/m-p/452156

     

    I am grabbing XML files from Onedrive and transforming them into JSON to be easily read by flow in a parse json.

     

     â€”Josh
    If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others

  • notj Profile Picture
    782 on at

    @v-alzhan-msft Why did you mark the solution when it's an answer to a question I didn't ask?

     

     

  • SteveCochrane Profile Picture
    219 on at

    The marked solution does not respond to the original question. There is a big difference between a simple well-formatted XML in OneDrive (the solution) and a complex InfoPath form (the question). Please remove the selected answer, and hopefully, someone else can provide a proper response.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 711

#2
Vish WR Profile Picture

Vish WR 691

#3
Haque Profile Picture

Haque 525

Last 30 days Overall leaderboard