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 Platform Community / Forums / Power Automate / EQUIVALENCES OF VARIOU...
Power Automate
Unanswered

EQUIVALENCES OF VARIOUS XML FILES FOR PARSE JSON

(0) ShareShare
ReportReport
Posted on by 296

Hello Community,


I have several XML files, but there are files that have one item and others have 5 or more items.


When using PARSE JSON, it works in some files but in another it gives me an error.


How can I do PARSE JSON equivalence for all my XML files?


I attach two files, the 714 file works fine for me, but the 951 gives me an error.

 

I leave images of the flow

 

fgonzalez515_0-1697936954590.png

 

 

fgonzalez515_1-1697936977365.png

 

 

Categories:
I have the same question (0)
  • Verified answer
    grantjenkins Profile Picture
    11,063 Moderator on at
    Re: EQUIVALENCES OF VARIOUS XML FILES FOR PARSE JSON

    You should ensure your schema caters for all scenarios - so includes all possible properties. However, you would likely need to remove any instances of required in the schema as this is likely what's causing the errors.

     

    So, in your schema, you may have instances such as that below which you should remove since some of the XML data doesn't include all properties.

     

    "required": [
     "NroLinDet",
     "CdgItem",
     "NmbItem",
     "DscItem",
     "QtyItem",
     "UnmdItem",
     "PrcItem",
     "MontoItem"
    ]
  • fgonzalez515 Profile Picture
    296 on at
    Re: EQUIVALENCES OF VARIOUS XML FILES FOR PARSE JSON

    Hi @grantjenkins 

     

    Thanks for your reply.
    I was able to solve Parse Json, with your solution.
    But since I want to make a Table with the data, I get this error when I use "Append to Array Variable".

    From what I see is that some XML in "Detalle" tells me array and others Object.
    How can I solve that?

     

    fgonzalez515_3-1697980605442.png

     

     

     

    fgonzalez515_2-1697980509104.png

     

     

     

    fgonzalez515_0-1697980431118.png

     

  • grantjenkins Profile Picture
    11,063 Moderator on at
    Re: EQUIVALENCES OF VARIOUS XML FILES FOR PARSE JSON

    That definitely makes it interesting. It might be better to work directly with the XML rather than converting it to JSON.

     

    What exactly are you trying to extract out of the XML documents? I can try to provide some XPath expressions that work on the XML once I know exactly what you're after.

  • fgonzalez515 Profile Picture
    296 on at
    Re: EQUIVALENCES OF VARIOUS XML FILES FOR PARSE JSON

    Hi @grantjenkins 

     

    Thanks for your answer.

    I was able to find a solution.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard