Referencing JSON payload value in Azure Data Factory for If condition

女生的网名这么多〃 提交于 2020-01-02 14:04:34

问题


I have a Json file like so as a payload returned from an API call - which is an http dataset type in data factory.

{
    "count": 2,
    "name": "DatasetABC",
    "columnNames": [
        "Column_1",
        "Column_2"

    ],
    "rows": ["1234",
             "5678"

    ]

}

I would like to be able to use the count records returned in an If condition. Im wondering what I need to use to get the value of "count" which is 2.

Any help appreciated.


回答1:


Based on your description, i suppose you could use LookUp Activity in Azure Data Factory.

Lookup activity can retrieve a dataset from any of the Azure Data Factory-supported data sources. Use it in the following scenario:

Dynamically determine which objects to operate on in a subsequent activity, instead of hard coding the object name. Some object examples are files and tables. Lookup activity reads and returns the content of a configuration file or table. It also returns the result of executing a query or stored procedure. The output from Lookup activity can be used in a subsequent copy or transformation activity if it's a singleton value. The output can be used in a ForEach activity if it's an array of attributes.

For example,maybe you could access the count value by using @{activity('MyLookupActivity').output.firstRow.count} in the IF activity.



来源:https://stackoverflow.com/questions/54934549/referencing-json-payload-value-in-azure-data-factory-for-if-condition

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!