0

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

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

7 Comments

I have used designer and this is formed automatically by Logic Apps. How to change?@{triggerBody()?['ListOfTestNames']}
You can change it from the code view
I removed { and } from code and it resulted in designer that ListOfNames became text instead of dynamic content.
You are mentioning @triggerBody()?['ListOfTestNames'] in your code view right? also would you mind sharing the code view of your logic app?
I have added code. Thank you for helping out. It is really strange and I get no value out from ListOfNames
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.