简体   繁体   中英

How to create html table from blob json in Azure Logic App

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) 应用程式流程 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?

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.

在此处输入图片说明

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

Here is the Logic flow and my result.

在此处输入图片说明

在此处输入图片说明

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.

在此处输入图片说明

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

Make sure these two steps are right: 在此处输入图片说明 在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM