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 / convert json output in...
Power Automate
Answered

convert json output into xml

(0) ShareShare
ReportReport
Posted on by 239

Hi,

is there a way to convert a json array output into an xml?

 

Regards,

Mohammad

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

    Hi @mokhawaja,

     

    I am afraid that currently it is not possible to convert JSON output into XML directly using Microsoft Flow. Please submit a request on Flow Ideas Forum about this issue:

    https://powerusers.microsoft.com/t5/Flow-Ideas/idb-p/FlowIdeas

    I will suggest other customers who have the same request to vote your idea at here.

     

    Best regards,

    Mabel Mao

  • mokhawaja Profile Picture
    239 on at

    Hi @v-yamao-msft,

    thanks for your reply... actually i was "partially successful" with some expressions, check the screenshot:

    Screenshot (78).pngScreenshot (79).png

    i was trying this so the file would open in excel.

    actually i tried this option to solve the unicode problem that i faced previously, check it here:

    https://powerusers.microsoft.com/t5/General-Flow-Discussion/save-as-csv-does-not-recognize-unicode-output-from-sql/m-p/125171#M13555

     

    i refered to this reference too:

    https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#xml

     

    thanks,

    Mohammad 

  • Verified answer
    mokhawaja Profile Picture
    239 on at

    Hi,

    Finally I am successful to convert json to xml file and send it as attachment, (but unfortunately it is very slow, as it should convert every item alone then recombine them back)... here it is:

     

    to explain why I needed xml, bacause it can deal with unicode data (i am using Arabic language in my data), so when I tried to export the data and save it as csv file, the unicode would be scrmbled like this

    Screenshot (16).png

    then I saw that there is a function that can convert json to xml, but discovered that it can only deal with json objects, and not arrays! 

    And with the inspiration from @sergeluca's blog of converting csv to json, (which I learnt a lot from about compose action and variables) i succeeded to convert the json output from execute SQL query action to xml file saved as *.xls, which will open in excel directly.

    So the magic is done using 4 compose actions: the first two compose actions inside an apply to each loop to convert each json object to xml format, then the 3rd will join all results from the apply to each using 

    join(outputs('Compose_2'), '')
    then the fourth compose action the add the xml "header"... check the screenshots:Screenshot (12).png

     

    Screenshot (13).png

     

    Screenshot (14).png

     

    Screenshot (15).png

     

    Then here when i recieve the file:
    open the attachmentopen the attachment

     

    click okclick ok

     

    wala...wala...

     

    but the main problem is the long duration for the execution of the flow espcially for large data sets! so it would be really great if Microsoft find a direct way to convert json to xml... or at least support unicode in csv creation!!
     
    Thanks,
    Mohammad

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!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 557

#2
Valantis Profile Picture

Valantis 328

#3
David_MA Profile Picture

David_MA 264 Super User 2026 Season 1

Last 30 days Overall leaderboard