I receive an XML file by email each day, and am trying to write a Flow / Power Automate to parse the XML, get 3 variables from it, and append these to a table in Excel. The XML file has below structure, its loaded into the query with the identifier InputXML
<?xml version="1.0" encoding="UTF-8"?>
<ifir:inter_fund_investor_report ifir:creation_date_time="2021-02-24T21:16:01"
ifir:report_id="102068045"
xmlns:ifir="nzl:org:fsc:XMLSchema:InterfundInvestorReport:v2.0">
<investor ifir:investor_name="client name" ifir:investor_id="client123">
<fund ifir:currency="USD" ifir:fund_valuation_date="2021-02-23" ifir:fund_name="Fund Name" ifir:fund_id="fundcode" ifir:is_fund_a_PIE="Y">
<balances>
<investor_units_held>123456</investor_units_held>
<total_units_on_issue>999999999</total_units_on_issue>
</balances>
<prices>
<base_price>1.060</base_price>
<entry_price>1.0650</entry_price>
<exit_price>1.055</exit_price>
</prices>
<totals ifir:fund_allocation_date="2021-02-23"/>
</fund>
</investor>
</ifir:inter_fund_investor_report>
I have been able to get the base_price
by using the expression:
xpath(xml(outputs('InputXML')),'//base_price')
I cannot however get the fund_name
or the fund_valuation_date
out from the XML.
Is someone able to help me with the XPath expression to get these two?
The XML file currently only has one fund_name
but could in the future have more, so I should also make the base_price
query conditional on that fund name if that is possible?