0

Hi I would like to create html tabe in Azure Logic App. I have data loaded from blob via Blob connector (Get blob content using path) app flow I used Compose connector based on answer in this post But I get error -

Unable to process template language expressions in action 'Create_HTML_table' inputs at line '1' and column '1747': 'The template language function 'json' parameter is not valid. The provided value '[{"ServiceName":"routingsf","SubServiceName":"roadinfo/supportedmaps","ErrorType":"System.AggregateException","ErrorMessage":"One or more errors occurred. (Object reference not set to an instance of an object.)","Count":4} ]' cannot be parsed: 'Unexpected character encountered while parsing value: . Path '', line 0, position 0.'. Please see https://aka.ms/logicexpressions#json for usage details.'.

Code of Compose and Create HTML table connector is like :

"Compose": {
            "inputs": "@base64ToString(body('Get_blob_content_using_path').$content)",
            "runAfter": {
                "Get_blob_content_using_path_2": [
                    "Succeeded"
                ]
            },
            "type": "Compose"
        },
        "Create_HTML_table": {
            "inputs": {
                "format": "HTML",
                "from": "@json(outputs('Compose'))"
            },
            "runAfter": {
                "Compose": [
                    "Succeeded"
                ]
            },
            "type": "Table"
        },

Can you help?

Tomáš Čičman
  • 281
  • 1
  • 5
  • 17

1 Answers1

0

Maybe you could try my way to create table. After get the content, use the Parse JSON , the content input json(body('Get_blob_content_using_path')), the Scheme choose Use sample payload to generate schema and just copy and paste your json file content.

enter image description here

Then create HTML table , the From choose the expression array(body('Parse_JSON')).

Here is the Logic flow and my result.

enter image description here

enter image description here

Hope this could help you, if you still have other questions, please let me know.

Update: I copy your json content tomy json file and test again. And It works.

enter image description here

So please make sure you logic app flow is right. Or you could share you flow.

Make sure these two steps are right: enter image description here enter image description here

George Chen
  • 13,703
  • 2
  • 11
  • 26
  • Thank you for answer, but this is not working for me. My json file content is array - `[{"ServiceName":"routingsf","SubServiceName":"distancematrix","ErrorType":"System.AggregateException","ErrorMessage":"One or more errors occurred. (Graph: v13/ta.2018.03_v900/irn/irn_car_overlay.fastest.xml.gz does not exist!)","Count":3} ]` and I getting error in parsing json - – Tomáš Čičman Jan 11 '19 at 08:20
  • Problem is with file in my opinion. My file is generated by copy activity from Data Factory. When I create json file on my PC and uploaded it on blob storade, all works fine. But When I try process generated file by DF, I get error described in question from Parse operation. - [link](https://imgur.com/a/hRtcLtW) – Tomáš Čičman Jan 11 '19 at 10:26
  • Did you mean you could parse Json with the blob using content, but couldn't parse Json from uploaded Json. And what's the detail about getting data from uploaded Json. – George Chen Jan 14 '19 at 07:57
  • And did you create your action "Parse Json" with my way. – George Chen Jan 14 '19 at 07:58
  • @Tomáš Čičman , any more questions? If it's helpful, you could accept it as the answer.Thanks! – George Chen Jan 23 '19 at 08:46