web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Issue with HTTP Reques...
Power Automate
Unanswered

Issue with HTTP Request as an XML response result

(0) ShareShare
ReportReport
Posted on by 1,710

Hello,

I have a flow with an HTTP request that sends a GET request to Dynamics NAV 2018.

I have tried to fetch data from the SalesInvoice table using Postman and it succeeded without any issues as below:

Julien2_0-1678714405171.png

 

The format of the data is returned in XML which I need to convert it later to JSON to parse the results.

I used the same concept in Power Automate as shown below:

Julien2_1-1678714525314.png

 

When I triggered the flow, it succeeded without any issues; however, the results were returned encrypted, and I could not see the real data.

 

Julien2_2-1678714591870.png

 

Is there any parameter that I am missing and that should be passed in the headers?

Any help is greatly appreciated.

Best regards,
Julien

Categories:
I have the same question (0)
  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    Just decode it. It is base64 encoded. 

  • EBMRay Profile Picture
    1,710 on at

    Hello  @Chriddle , 

    Thank you for your suggestion.

    Below are the steps that I did:

    1. I simply converted it to string so now results are showing perfectly in an XML format.

    2. I converted the XML to JSON using the JSON expression below:

    @{json(xml(outputs('Compose_2')))}

    3. I used Parse JSON and passed the result coming from JSON conversion.

     

     

    {
     "body": {
     "?xml": {
     "@version": "1.0",
     "@encoding": "utf-8"
     },
     "feed": {
     "@xml:base": "test.cloudapp.azure.com:7048/DynamicsNAV110/OData/",
     "@xmlns": "http://www.w3.org/2005/Atom",
     "@xmlns:d": "http://schemas.microsoft.com/ado/2007/08/dataservices",
     "@xmlns:m": "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata",
     "id": "test.cloudapp.azure.com:7048/DynamicsNAV110/OData/Company('Test')/SalesInvoice",
     "title": {
     "@type": "text",
     "#text": "SalesInvoice"
     },
     "updated": "2023-03-13T19:53:07Z",
     "link": {
     "@rel": "self",
     "@title": "SalesInvoice",
     "@href": "SalesInvoice"
     },
     "entry": {
     "@m:etag": "W/\"'52%3BJAAAAACLAgAAAAJ7%2F1MASQAwADAAMAAwADAAOAA0ADIANAAAAAAA9%3B1725748070%3B'\"",
     "id": "test.cloudapp.azure.com:7048/DynamicsNAV110/OData/Company('Test')/SalesInvoice(Document_Type='Invoice',No='SI000008424')",
     "category": {
     "@term": "NAV.SalesInvoice",
     "@scheme": "http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"
     },
     "link": [
     {
     "@rel": "edit",
     "@title": "SalesInvoice",
     "@href": "Company('Test')/SalesInvoice(Document_Type='Invoice',No='SI000008424')"
     },
     {
     "@rel": "http://schemas.microsoft.com/ado/2007/08/dataservices/related/SalesInvoiceSalesLines",
     "@type": "application/atom+xml;type=feed",
     "@title": "SalesInvoiceSalesLines",
     "@href": "Company('Test')/SalesInvoice(Document_Type='Invoice',No='SI000008424')/SalesInvoiceSalesLines"
     },
     {
     "@rel": "http://schemas.microsoft.com/ado/2007/08/dataservices/related/Location_Code_Link",
     "@type": "application/atom+xml;type=entry",
     "@title": "Location_Code_Link",
     "@href": "Company('Test')/SalesInvoice(Document_Type='Invoice',No='SI000008424')/Location_Code_Link"
     }
     ],
     "title": null,
     "updated": "2023-03-13T19:53:07Z",
     "author": {
     "name": null
     },
     "content": {
     "@type": "application/xml",
     "m:properties": {
     "d:Document_Type": "Invoice",
     "d:No": "SI000008424",
     "d:Sell_to_Customer_No": "C0001333",
     "d:Sell_to_Customer_Name": "Test",
     "d:Academic_Year": "2019-2020",
     "d:Application_No": "APP0001616",
     "d:Student_No": "ST0001421",
     "d:Class": "RWNGA-C-01",
     "d:Section": "",
     "d:Fee_Start_Date": {
     "@m:type": "Edm.DateTime",
     "#text": "0001-01-01T00:00:00"
     },
     "d:Fee_End_Date": {
     "@m:type": "Edm.DateTime",
     "#text": "0001-01-01T00:00:00"
     },
     "d:Sell_to_Address": "",
     "d:Sell_to_Address_2": "",
     "d:Sell_to_Post_Code": "",
     "d:Sell_to_City": "",
     "d:Sell_to_Contact_No": "",
     "d:Sell_to_Contact": "",
     "d:Your_Reference": "",
     "d:Document_Date": {
     "@m:type": "Edm.DateTime",
     "#text": "2019-12-31T00:00:00"
     },
     "d:Posting_Date": {
     "@m:type": "Edm.DateTime",
     "#text": "2019-12-31T00:00:00"
     },
     "d:Due_Date": {
     "@m:type": "Edm.DateTime",
     "#text": "2019-12-31T00:00:00"
     },
     "d:Incoming_Document_Entry_No": {
     "@m:type": "Edm.Int32",
     "#text": "0"
     },
     "d:External_Document_No": "APP0001616/ST0001421",
     "d:Salesperson_Code": "",
     "d:Campaign_No": "",
     "d:Responsibility_Center": "RWN-GA",
     "d:Assigned_User_ID": "",
     "d:Status": "Open",
     "d:Job_Queue_Status": {
     "@xml:space": "preserve",
     "#significant-whitespace": " "
     },
     "d:WorkDescription": "",
     "d:Currency_Code": "",
     "d:Shipment_Date": {
     "@m:type": "Edm.DateTime",
     "#text": "2019-12-31T00:00:00"
     },
     "d:Quote_No": "SQ10980",
     "d:Prices_Including_VAT": {
     "@m:type": "Edm.Boolean",
     "#text": "false"
     },
     "d:VAT_Bus_Posting_Group": "VAT5",
     "d:Payment_Terms_Code": "",
     "d:Payment_Method_Code": "",
     "d:EU_3_Party_Trade": {
     "@m:type": "Edm.Boolean",
     "#text": "false"
     },
     "d:SelectedPayments": "No payment service is made available.",
     "d:Transaction_Type": "",
     "d:Shortcut_Dimension_1_Code": "RWN-GA",
     "d:Shortcut_Dimension_2_Code": "RWNGA-C-01",
     "d:Payment_Discount_Percent": {
     "@m:type": "Edm.Decimal",
     "#text": "0"
     },
     "d:Pmt_Discount_Date": {
     "@m:type": "Edm.DateTime",
     "#text": "0001-01-01T00:00:00"
     },
     "d:Direct_Debit_Mandate_ID": "",
     "d:Location_Code": "RWN-GA",
     "d:ShippingOptions": "Default (Sell-to Address)",
     "d:Ship_to_Code": "",
     "d:Ship_to_Name": "Test",
     "d:Ship_to_Address": "",
     "d:Ship_to_Address_2": "",
     "d:Ship_to_Post_Code": "",
     "d:Ship_to_City": "",
     "d:Ship_to_Country_Region_Code": "",
     "d:Ship_to_Contact": "",
     "d:Shipment_Method_Code": "",
     "d:Shipping_Agent_Code": "",
     "d:Shipping_Agent_Service_Code": "",
     "d:Package_Tracking_No": "",
     "d:BillToOptions": "Default (Customer)",
     "d:Bill_to_Name": "Testu",
     "d:Bill_to_Address": "",
     "d:Bill_to_Address_2": "",
     "d:Bill_to_Post_Code": "",
     "d:Bill_to_City": "",
     "d:Bill_to_Contact_No": "",
     "d:Bill_to_Contact": "",
     "d:Transaction_Specification": "",
     "d:Transport_Method": "",
     "d:Exit_Point": "",
     "d:Area": "",
     "d:ETag": "52;JAAAAACLAgAAAAJ7/1MASQAwADAAMAAwADAAOAA0ADIANAAAAAAA9;1725748070;"
     }
     }
     }
     }
     }
    }

     

     

    4. when it comes to extracting the data from the JSON I am struggling with that as the flow is failing and returning null:

     

     

    @{body('Parse_JSON')?['body']?['feed']}

    Julien2_0-1678737654074.png

    ApplyToEachFailed.png

    Could you please advise how to resolve it?

     

    Thank you!

     

     

     

     

  • Verified answer
    Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    In PA, the @ is a special character that must be escaped.
    Use replace(your_string, '@', '@@') before converting to json.

    (In the Parse JSON schema you must not escape them)

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard