如何将数组从 ADF 的 Web Activity 发送到 Logic App Webhook?

How to send array from Web Activity of ADF to Logic App Webhook?

我尝试从 Web Activity Azure 数据工厂发送列表,但我无法使 list/array 正确传递到 webhook。请指教!

我以本教程为基础:

   https://www.youtube.com/watch?v=ttmETFGYSLg

我在 Azure 数据工厂 Post 中有 Web activity 正文:(这工作正常)

  {
  "ListOfTestNames:" : @{variables('Test_name_list')}
 }

我有带有“收到 HTTP 请求时”的逻辑应用程序。设置了方法 Post 并且架构如下:

 {
  "properties": {
    "ListOfTestNames": {
      "type": "array"
    }
},
"type": "object"
}

我在逻辑应用程序中有 HTTP Webhook。这工作正常并且 return 正文包括 ListOfTestName

       @{triggerBody()}

我在逻辑中有 HTTP Webhook Apps:This 没有 return 任何东西。我想知道为什么?

       @{triggerBody()?['ListOfTestNames']} 

我尝试了 Array 和 String 两种类型

逻辑应用程序代码:(由设计师生成) {

    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "HTTP_Webhook": {
                "inputs": {
                    "subscribe": {
                        "body": {
                            "blocks": [
                                {
                                    "text": {
                                        "text": "*These are list of names* \n ListOfTestNames @{triggerBody()?['ListOfTestNames:']}   ",
                                        "type": "mrkdwn"
                                    },
                                    "type": "section"
                                },
                                {
                                    "text": {
                                        "text": "There is currently bug and list of names are not displayed ",
                                        "type": "mrkdwn"
                                    },
                                    "type": "section"
                                }
                            ]
                        },
                        "method": "POST",
                        "uri": "https://hooks.slack.com/services/11111111111111111111111111111111111111111"
                    },
                    "unsubscribe": {}
                },
                "runAfter": {},
                "type": "HttpWebhook"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "parameters": {},
        "triggers": {
            "manual": {
                "inputs": {
                    "method": "POST",
                    "schema": {
                        "properties": {
                            "ListOfTestNames:": {
                                "type": "array"
                            }
                        },
                        "type": "object"
                    }
                },
                "kind": "Http",
                "type": "Request"
            }
        }
    },
    "parameters": {}
}

在我们重现问题后,我们发现您使用的表达式无效,但是当我们尝试使用时它有效

 @triggerBody()?['ListOfTestNames'] 

但使用时不是

 @{triggerBody()?['ListOfTestNames']} 

以下截图供您参考:

  • 使用@triggerBody()?['ListOfFiles']时:

  • 当使用@triggerBody()时: