Kenny_I
Kenny_I

Reputation: 2503

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

I try to send list from Web Activity Azure Data Factory, but I cannot make list/array to passed correctly to webhook. Please advice!

I have used this tutorial as base:

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

I have Web activity in Azure Data Factory Posting following body: (this works fine)

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

I have Logic Apps with "When HTTP request is received".Method is set Post and Schema is followings:

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

I have HTTP Webhook in Logic Apps. This works fine and return body including ListOfTestName

       @{triggerBody()}

I have HTTP Webhook in Logic Apps:This does not return anything. I wonder why?

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

enter image description here

I tried both type Array and String

enter image description here

Logic Apps Code: (generated by designer) {

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

Upvotes: 0

Views: 968

Answers (1)

SwethaKandikonda
SwethaKandikonda

Reputation: 8234

After reproducing the problem on our end, we discovered that the expression you're using is invalid, however it worked when we tried to use

 @triggerBody()?['ListOfTestNames'] 

but not when using

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

Here are the screenshots for your reference:

  • When @triggerBody()?['ListOfFiles'] is used:

    enter image description here

  • When @triggerBody() is used :

    enter image description here

Upvotes: 1

Related Questions