0

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

我以本教程为基础:

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

我在 Azure 数据工厂中有 Web 活动发布以下正文:(这工作正常)

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

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

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

我在逻辑应用中有 HTTP Webhook。这工作正常并返回包括 ListOfTestName 的正文

       @{triggerBody()}

我在逻辑应用中有 HTTP Webhook:这不会返回任何内容。我想知道为什么?

       @{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": {}
}
4

1 回答 1

1

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

 @triggerBody()?['ListOfTestNames'] 

但在使用时不会

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

以下是供您参考的屏幕截图:

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

    在此处输入图像描述

  • 何时@triggerBody()使用:

    在此处输入图像描述

于 2021-11-17T03:51:09.053 回答