【问题标题】:How to create html table from blob json in Azure Logic App如何在 Azure Logic App 中从 blob json 创建 html 表
【发布时间】:2019-06-05 11:37:09
【问题描述】:

您好,我想在 Azure Logic App 中创建 html tabe。 我通过 Blob 连接器从 Blob 加载了数据(使用路径获取 Blob 内容) 我根据this post 中的答案使用了 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 表格连接器的代码如下:

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

你能帮忙吗?

【问题讨论】:

    标签: json html-table azure-logic-apps


    【解决方案1】:

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

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

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

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

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

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

    确保这两个步骤正确:

    【讨论】:

    • 感谢您的回答,但这对我不起作用。我的 json 文件内容是数组 - [{"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} ] 我在解析 json 时出错 -
    • 我认为问题出在文件上。我的文件是由数据工厂的复制活动生成的。当我在 PC 上创建 json 文件并将其上传到 blob 存储时,一切正常。但是当我尝试通过 DF 处理生成的文件时,我从 Parse 操作中得到了有问题的错误描述。 - link
    • 您的意思是您可以使用内容解析带有 blob 的 Json,但无法从上传的 Json 中解析 Json。以及从上传的 Json 中获取数据的细节是什么。
    • 你用我的方式创建了你的动作“Parse Json”吗?
    • @Tomáš Čičman,还有问题吗?如果它有帮助,您可以接受它作为答案。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-08-31
    • 1970-01-01
    • 1970-01-01
    • 2017-12-20
    • 2021-07-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多