如何在 Azure 逻辑应用程序中从 blob json 创建 html table

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

您好,我想在 Azure 逻辑应用程序中创建 html 表。 我通过 Blob 连接器从 blob 加载了数据(使用路径获取 blob 内容) 我根据 中的答案使用了 Compose 连接器 但我收到错误 -

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.'.

编写和创建 HTML table 连接器的代码如下:

"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"
        },

你能帮忙吗?

也许你可以试试我的方法来创建 table。获取内容后,使用 Parse JSON ,内容输入 json(body('Get_blob_content_using_path')),Scheme 选择 Use sample payload to generate schema 然后复制粘贴你的 json 文件内容.

然后创建 HTML table , From 选择表达式 array(body('Parse_JSON')).

这是逻辑流程和我的结果。

希望对您有所帮助,如果您还有其他问题,请告诉我。

更新:我将您的 json 内容复制到我的 json 文件并再次测试。并且有效。

所以请确保您的逻辑应用程序流程是正确的。或者你可以分享你的流程。

确保这两个步骤是正确的: