可以使用动态表达式设置 Flatten 活动的展开参数。具体步骤如下所示:
下面是一个带有动态表达式的 Flatten 活动示例:
{
"name": "flatten1",
"type": "Flatten",
"dependsOn": [],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false
},
"userProperties": [],
"typeProperties": {
"columns": [
"OrderID",
"Item",
"Quantity"
],
"unroll": {
"column": {
"value": "@concat('Item',toString(addIndex(1)))",
"type": "Expression"
},
"depth": {
"value": "@concat('Data',toString(addIndex(1)))",
"type": "Expression"
}
}
}
}
在这个示例中,展开参数使用了动态表达式,它们会根据序号动态设置要展开的列和展开的级别。这种方法可以处理动态展开的情况。