0

With Azure Data Factory v2, I created Web Activity using the POST method and got the desired response output. But can't get the rows data from the output response in the next activity.

How do I reference columns in the rows in this output? The data in the rows doesn't have any headers.

{
"Tables": [
    {
        "TableName": "Table_0",
        "Columns": [
            {
                "ColumnName": "MyFieldA",
                "DataType": "String",
                "ColumnType": "string"
            },
            {
                "ColumnName": "MyFieldB",
                "DataType": "String",
                "ColumnType": "string"
            }
        ],
        "Rows": [
            [
                "ABCDEF",
                "AAAABBBBBCCCDDDDD"
            ],
            [
                "CCCCCCC",
                "CCCCCCC"
            ],

I can't reference the value in the rows I've tried numerous things e.g. @activity('WebActivity').output.Rows

Nothing seems to work. What's the point of getting a response from a web activity and then not being able to reference the output in data factory?

2 Answers 2

1

Thanks Pacodel!!! You've helped me out. And to use in the a For Each Loop and Array, when I pass in the Rows to my Execute pipeline activity @activity('WebActivity').output.Tables[0].Rows:

[
   [
    "ABCDEF",
    "AAAABBBBBCCCDDDDD"
   ],
   [
    "CCCCCCC",
    "CCCCCCC"
   ]
]

I can use the following to reference the rows:

@{item()[0]}
@{item()[1]}

I use the @item to populate parameters in a stored procedure activity which loads my table

Thanks

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

Comments

0

For your example.

@activity('WebActivity').output.Tables[0].Rows will return the following:

[
    [
        "ABCDEF",
        "AAAABBBBBCCCDDDDD"
    ],
    [
        "CCCCCCC",
        "CCCCCCC"
    ]
]

If you want to access even deeper, you just need to specify the index. @activity('WebActivity').output.Tables[0].Rows[0][0] will return ABCDEF

If you need to automate this, you can have a pattern of foreach with an execute pipeline inside passing an array as a parameter until you get to the properties that you need.

1 Comment

Thanks. I have tried various version of the above but not quite there yet. I do execute pipeline passing in parameter @activity('WebActivity').output.Tables[0].Rows which provides the next pipeline array with the data rows as per your example above. "just the rows" and use a for each look and then I'm trying to reference the rows in the array with @{item().Rows[0]} or variations of. But it doesn't work... The rows doesn't have any tags and I'm not sure what the syntax is to reference them. I have also tried @{item().[0]} and so on

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.