cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
YoanVDS
New Member

Unable to use XML data

Hello everyone,

 

At some point in a Flow, I need to extract data from an XML document stored in OneDrive for Business.
I found plenty of subjects about parsing XML with xmlpath(xml(file),'field_to_parse') but I still can't achieve to use the data I want to extract.
For some reason, the Flow executes well, but return " " or "[]" when I call the xmlpath method.

Here are some screens to make you understand it.

The XML file and the data that I need to use:

YoanVDS_0-1604668542309.png

 

The actions used to parse XML:

YoanVDS_1-1604668600619.png

One of the unsuccessful execution:

YoanVDS_2-1604668686732.png

The current method (I changed it like 20 times since yesterday, trying to use base64ToBinary(file), 'string(field)', etc): xpath(xml(outputs('Message')),'//bilans').

 

Some help would be much appreciated...
Thank you anyway,
Yoan

4 REPLIES 4
Paulie78
Super User
Super User

Could you put the XML in a code block on here? then we could copy it into a flow and test it? (or put it on pastebin.com )

<?xml version="1.0" encoding="UTF-8"?>

-<bilans xmlns="fr:inpi:odrncs:bilansSaisisXML" version="1.0">


-<bilan>


-<identite>

<siren>802863746</siren>

<date_cloture_exercice>20190930</date_cloture_exercice>

<code_greffe>6752</code_greffe>

<num_depot>5065</num_depot>

<num_gestion>2014B01233</num_gestion>

<code_activite>6420Z</code_activite>

<date_cloture_exercice_n-1>20180930</date_cloture_exercice_n-1>

<duree_exercice_n>12</duree_exercice_n>

<duree_exercice_n-1>12</duree_exercice_n-1>

<date_depot>20200610</date_depot>

<code_motif>00</code_motif>

<code_type_bilan>C</code_type_bilan>

<code_devise>EUR</code_devise>

<code_origine_devise>O</code_origine_devise>

<code_confidentialite>0</code_confidentialite>

<info_traitement/>


-<denomination>

-<![CDATA[SOGEDIS]]>
</denomination>


-<adresse>

-<![CDATA[67118 Geispolsheim]]>
</adresse>

</identite>


-<detail>


-<page numero="01">

<liasse m4="000000022636955" m3="000000022636955" m1="000000022636955" code="CU"/>

<liasse m4="000000000066475" m3="000000000066475" m1="000000000066475" code="BD"/>

<liasse m4="000000022703430" m3="000000022703430" m1="000000022703430" code="BJ"/>

<liasse m4="000000001447286" m3="000000003287134" m1="000000003287134" code="BZ"/>

<liasse m4="000000001395480" m3="000000001400000" m1="000000001400000" code="CD"/>

<liasse m4="000000000522015" m3="000000000195659" m1="000000000195659" code="CF"/>

<liasse m4="000000003364781" m3="000000004882793" m1="000000004882793" code="CJ"/>

<liasse m4="000000026068211" m3="000000027586223" m1="000000027586223" code="CO"/>

</page>


-<page numero="02">

<liasse m1="000000004587000" code="DA" m2="000000004587000"/>

<liasse m1="000000000249141" code="DD" m2="000000000087717"/>

<liasse m1="000000003224553" code="DG" m2="000000001162051"/>

<liasse m1="000000003625710" code="DI" m2="000000003228479"/>

<liasse m1="000000000020101" code="DK" m2="000000000018100"/>

<liasse m1="000000011706505" code="DL" m2="000000009083347"/>

<liasse m1="000000014978389" code="DU" m2="000000016370659"/>

<liasse m1="000000000023198" code="DX" m2="000000000019573"/>

<liasse m1="000000000878131" code="EA" m2="000000000594631"/>

<liasse m1="000000015879718" code="EC" m2="000000016984864"/>

<liasse m1="000000027586223" code="EE" m2="000000026068211"/>

</page>


-<page numero="03">

<liasse m3="000000000000553" code="FQ"/>

<liasse m3="000000000000553" code="FR"/>

<liasse m4="000000000020203" m3="000000000018332" code="FW"/>

<liasse m4="000000000000161" m3="000000000000153" code="FX"/>

<liasse m4="000000000000180" code="GE"/>

<liasse m4="000000000020544" m3="000000000018485" code="GF"/>

<liasse m4="-000000000020544" m3="-000000000017932" code="GG"/>

<liasse m4="000000003288898" m3="000000003727418" code="GJ"/>

<liasse m4="000000000000599" m3="000000000000599" code="GK"/>

<liasse m4="000000000097263" m3="000000000006574" code="GL"/>

<liasse m4="000000000031926" m3="000000000004520" code="GM"/>

<liasse m4="000000003418686" m3="000000003739111" code="GP"/>

<liasse m4="000000000004520" code="GQ"/>

<liasse m4="000000000175601" m3="000000000132320" code="GR"/>

<liasse m4="000000000180121" m3="000000000132320" code="GU"/>

<liasse m4="000000003238565" m3="000000003606790" code="GV"/>

<liasse m4="000000003218021" m3="000000003588859" code="GW"/>

</page>


-<page numero="04">

<liasse m1="000000000002001" code="HG" m2="000000000004000"/>

<liasse m1="000000000002001" code="HH" m2="000000000004000"/>

<liasse m1="-000000000002001" code="HI" m2="-000000000004000"/>

<liasse m1="-000000000038852" code="HK" m2="-000000000014458"/>

<liasse m1="000000003739664" code="HL" m2="000000003418686"/>

<liasse m1="000000000113954" code="HM" m2="000000000190208"/>

<liasse m1="000000003625710" code="HN" m2="000000003228479"/>

</page>


-<page numero="05">

<liasse m1="000000022703430" code="LQ"/>

<liasse m1="000000022703430" code="0G"/>

<liasse m3="000000022703430" code="I3"/>

<liasse m3="000000022703430" code="I4"/>

</page>


-<page numero="07">

<liasse m4="000000000020101" code="3X"/>

<liasse m4="000000000020101" m1="000000000018100" code="3Z" m2="000000000002001"/>

<liasse m3="000000000004520" m1="000000000004520" code="6X"/>

<liasse m3="000000000004520" m1="000000000004520" code="7B"/>

<liasse m4="000000000020101" m3="000000000004520" m1="000000000022620" code="7C" m2="000000000002001"/>

<liasse m3="000000000004520" code="UG"/>

<liasse code="UJ" m2="000000000002001"/>

</page>


-<page numero="08">

<liasse m1="000000000445894" code="VM" m2="000000000445894"/>

<liasse m1="000000002840616" code="VC" m2="000000002840616"/>

<liasse m1="000000000000624" code="VR" m2="000000000000624"/>

<liasse m1="000000003287134" code="VT" m2="000000003287134"/>

<liasse m4="000000007824749" m3="000000005730718" m1="000000014978389" code="VH" m2="000000001422922"/>

<liasse m1="000000000023198" code="8B" m2="000000000023198"/>

<liasse m1="000000000878131" code="VI" m2="000000000878131"/>

<liasse m4="000000007824749" m3="000000005730718" m1="000000015879718" code="VY" m2="000000002324251"/>

<liasse m1="000000001390524" code="VK"/>

</page>

</detail>

</bilan>

</bilans>

There you are, I want to access the top fields, in "identité" (such as code_greffe, code_motif...)

Paulie78
Super User
Super User

Well, it does not validate as valid XML, so that it going to make things difficult. I don't just mean within Power Automate, I mean within general xml tools.

It appeared yeah that the xmlns was the problem source, I just found this with my collegues... I lost roughly 2 days on a ill-formated namespace...

Thank you anyway

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,528)