Search code examples
schemabiztalkflat-fileazure-logic-apps

Azure Logics App - Flat file decode return random string


I want to decode a flat file to XML using the schema however i got some random string return in output. I use the Flat File Decoding Connector in Enterprise Integration Pack. Can you please help?

Here is my input

{  
  "content": "PO1999-10-20\r\nUS        Alice Smith         123 Maple Street    Mill Valley    CA 90952\r\nUS        Robert Smith        8 Oak Avenue        Old Town       PA 95819\r\nITEMS,ITEM872-AA|Lawnmower|1|148.95|Confirm this is electric,ITEM926-AA|Baby Monitor|1|39.98|Confirm this is electric", 
  "integrationAccount": 
  {
        "schema": {            "name": "FlatFile"        }    
  }
}

and here is my output

{    
  "body": 
  {        
       "$content-type": "application/xml;charset=utf-8",        
       "$content": "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjxQTyB4bWxucz0iaHR0cDovL0JpelRhbGtfU2VydmVyX1Byb2plY3QxLlBPIj4NCiAgPGRhdGUgeG1sbnM9IiI+MTk5OS0xMC0yMDwvZGF0ZT4NCiAgPGN1c3RvbWVyIHhtbG5zPSIiPg0KICAgIDxjb3VudHJ5PlVTPC9jb3VudHJ5Pg0KICAgIDxGdWxsTmFtZT5BbGljZSBTbWl0aDwvRnVsbE5hbWU+DQogICAgPFN0cmVldD4xMjMgTWFwbGUgU3RyZWV0PC9TdHJlZXQ+DQogICAgPENpdHk+TWlsbCBWYWxsZXk8L0NpdHk+DQogICAgPFN0YXRlPkNBPC9TdGF0ZT4NCiAgICA8UG9zdGFsQ29kZT45MDk1MjwvUG9zdGFsQ29kZT4NCiAgPC9jdXN0b21lcj4NCiAgPGN1c3RvbWVyIHhtbG5zPSIiPg0KICAgIDxjb3VudHJ5PlVTPC9jb3VudHJ5Pg0KICAgIDxGdWxsTmFtZT5Sb2JlcnQgU21pdGg8L0Z1bGxOYW1lPg0KICAgIDxTdHJlZXQ+OCBPYWsgQXZlbnVlPC9TdHJlZXQ+DQogICAgPENpdHk+T2xkIFRvd248L0NpdHk+DQogICAgPFN0YXRlPlBBPC9TdGF0ZT4NCiAgICA8UG9zdGFsQ29kZT45NTgxOTwvUG9zdGFsQ29kZT4NCiAgPC9jdXN0b21lcj4NCiAgPGl0ZW1zIHhtbG5zPSIiPg0KICAgIDxpdGVtc19DaGlsZDE+DQogICAgICA8cHJvZHVjdENvZGU+ODcyLUFBPC9wcm9kdWN0Q29kZT4NCiAgICAgIDxEZXNjcmlwdGlvbj5MYXdubW93ZXI8L0Rlc2NyaXB0aW9uPg0KICAgICAgPFF1YW50aXR5PjE8L1F1YW50aXR5Pg0KICAgICAgPFVuaXRQcmljZT4xNDguOTU8L1VuaXRQcmljZT4NCiAgICAgIDxOb3Rlcz5Db25maXJtIHRoaXMgaXMgZWxlY3RyaWM8L05vdGVzPg0KICAgIDwvaXRlbXNfQ2hpbGQxPg0KICAgIDxpdGVtc19DaGlsZDE+DQogICAgICA8cHJvZHVjdENvZGU+OTI2LUFBPC9wcm9kdWN0Q29kZT4NCiAgICAgIDxEZXNjcmlwdGlvbj5CYWJ5IE1vbml0b3I8L0Rlc2NyaXB0aW9uPg0KICAgICAgPFF1YW50aXR5PjE8L1F1YW50aXR5Pg0KICAgICAgPFVuaXRQcmljZT4zOS45ODwvVW5pdFByaWNlPg0KICAgICAgPE5vdGVzPkNvbmZpcm0gdGhpcyBpcyBlbGVjdHJpYzwvTm90ZXM+DQogICAgPC9pdGVtc19DaGlsZDE+DQogIDwvaXRlbXM+DQo8L1BPPg=="    
  }

and here is my schema at https://pastebin.com/Xhqc30bJ


Solution

  • What you are seeing is correct.

    What you're seeing there is the Base64 encoded Xml Output of the Flat File Decoder. If you decode that string in a text editor, you'll see you Xml.

    This is just how the LogicApp engine works internally. When you try to use it, it will decode the contents of $content automatically.

    Basically, you fine. No problem at all :)