为 If 条件引用 Azure 数据工厂中的 JSON 负载值

Referencing JSON payload value in Azure Data Factory for If condition

我有一个 Json 文件,作为从 API 调用返回的有效负载 - 这是数据工厂中的 http 数据集类型。

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

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

    ]

}

我希望能够使用在 If 条件下返回的计数记录。我想知道我需要用什么来获得 "count" 的值,即 2.

感谢任何帮助。

根据您的描述,我想您可以在 Azure 数据工厂中使用 LookUp Activity

Lookup activity 可以从任何 Azure 数据工厂支持的数据源中检索数据集。在以下场景中使用它:

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.

例如,也许您可​​以使用 IF activity 中的 @{activity('MyLookupActivity').output.firstRow.count} 来访问计数值。