首页 文章

在Azure数据工厂中查找和预览Web活动:@Item()返回null

提问于
浏览
1

如下面链接所述,我首先触发Lookup . 它给了我电子邮件ID,然后对于每个电子邮件ID,我正在调用POST请求 .

Iterating Through azure SQL table in Azure Data Factory

我在For each的设置中的项目中提到了@pipeline() . parameters.tableList . 我之后每次都设置了一个电子邮件通知来检查@pipeline() . parameters.leadList的输出 . 到目前为止,我正确地得到它 .

但是当我使用@item()时,它返回null .

我很困惑为什么@item()给我null,即使@pipeline() . 子管道中的parameters.leadList给我正确的值?

我遵循这种方法:https://docs.microsoft.com/en-us/azure/data-factory/tutorial-bulk-copy-portal

Parent pipeline

{“name”:“LookupToSF”,“properties”:{“activities”:[{“name”:“LookupToSF”,“description”:“从Salesforce的Lead表中检索潜在客户名称和电子邮件ID”,“键入“:”查找“,”策略“:{”timeout“:”7.00:00:00“,”重试“:0,”retryIntervalInSeconds“:30,”secureOutput“:false},”typeProperties“:{”source “:{”type“:”SalesforceSource“,”query“:”选择名称,电子邮件来自lead where email ='abb@xxxx.com'“,”readBehavior“:”query“},”dataset“:{”referenceName “:”SalesforceObjectToAddPersonAskNicely“,”type“:”DatasetReference“},”firstRowOnly“:false}},{”name“:”TriggerForEachLead“,”type“:”ExecutePipeline“,”dependsOn“:[{”activity“: “LookupToSF”,“dependencyConditions”:[“Succeeded”]}],“typeProperties”:{“pipeline”:{“referenceName”:“SendSurvey”,“type”:“PipelineReference”},“waitOnCompletion”:true,“参数“:{”leadList“:{”value“:”@ activity('LookupToSF') . output.value“,”type“:”Expression“}}}}]}}

**

Child pipeline

{"name":"SendSurvey","properties":{"activities":[{"name":"ForEachLead","type":"ForEach","typeProperties":{"items":{"value":"@pipeline().parameters.leadList","type":"Expression"},"isSequential":true,"activities":[{"name":"WebActivityToAddPerson","type":"WebActivity" ,"policy":{"timeout":"7.00:00:00","retry":0,"retryIntervalInSeconds":30,"secureOutput":假},"typeProperties":{"url":“https://xxxx.asknice.ly/api/v1/person/trigger ", "方法": " POST ", "头": { " X-apikey ": " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx " }, "数据": { "电子邮件": " @ {项目() .Email} ", " addPerson的": "真正" } } }, { "名": " WebActivityForErrorAddingPerson ", "型": " WebActivity ", " dependsOn ": [ { "活动": " WebActivityToAddPerson ", " dependencyConditions ": [ "失败" ] } ], "政策": { "超时": " 7.00:00:00 ", "重试": 0, " retryIntervalInSeconds ": 30, " secureOutput ": false }, " typeProperties ": { "网址": " https://prod-07.australiaeast.logic.azure.com:443/workflows/xxxxxxxxxxxxx ", "方法": " POST ", "头": { "内容类型": "应用/ JSON " }, "体": { "状态": "失败", "消息": " @ {活性('WebActivityToAddPerson').OUTPUT} ", "受试者": "失灵加入" } } }, { "名": " WebActivityToSendSurvey ", "类型": " WebActivity ", " dependsOn ": [ { "活性": " WebActivityToAddPerson ", " dependencyConditions ": [ "完成" ] } ], "政策": { "超时": " 7.00:00:00 ", "重试": 0, " retryIntervalInSeconds ": 30, " secureOutput ": false }, " typeProperties ": { " URL ": " https://xxxxxxxx.asknice.ly/api/v1/person/trigger ", "方法": " POST ", "头": { " X-apikey ": " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx " }, "数据": "电子邮件= @ {项目()电子邮件 . }&triggeremail = true " } }, { " name ": " WebActivityForErrorSendingSurvey ", " type ": " WebActivity ", " dependsOn ": [ { " activity ": " WebActivityToSendSurvey ", " dependencyConditions ": [ "失败_9554 83_政策": { "超时": " 7.00:00:00 ", "重试": 0, " retryIntervalInSeconds ": 30, " secureOutput ": false }, " typeProperties ": { " URL ": " https://prod-07.australiaeast.logic.azure.com:443/workflows/xxxxxxxxxxxxxxxxx ", "方法": " POST ", "头": { "内容类型": "应用/ JSON " }, "体": { "状态": "失败", "消息": " @ {活性('WebActivityToAddPerson' ).OUTPUT} ", "主题": "未能在加入" } } }, { "名": " UserAddingNotification ", "型": " WebActivity ", " dependsOn ": [ { "活动": " WebActivityToAddPerson ", " dependencyConditions ": [ "成功" ] } ], "政策": { "超时": " 7.00:00:00 ", "重试": 0, " retryIntervalInSeconds ": 30, " secureOutput ": false }, " typeProperties ": { "网址": " https://prod-07.australiaeast.logic.azure.com:443/workflows/xxxxxxxxxxxxxxxxxxxxx ", "方法": " POST ", " headers ": { " Content-Type ": " application / json " }, " body ": { " Status ": " Success ", " message ": " @ {activity('WebActivityToAddPerson').output} 95553 5 subject ": "用户已成功/已成功更新" } } } ] } }, { " name ": " SuccessSurveySentNotification ", " type ": " WebActivity ", " dependsOn ": [ { " activity ": " ForEachLead ", " dependencyConditions ": [ "成功" ] } ], " policy ": { " timeout": " 7.00:00:00 ", "重试": 0, " retryIntervalInSeconds ": 30, " secureOutput ": false }, " typeProperties ": { " url ": " https://prod-07.australiaeast.logic.azure.com:443/workflows/xxxxxxxxxxxxxxxxxxxxxx ", " method ": " POST ", " headers ": { " Content-Type ": " application / json " }, " body ": { " Status ": " Success ", " message ": " @ {item()} ", " subject ": "调查发送成功" } } } ], "参数": { " leadList ": { "类型": "对象“}}}}

1 回答

  • 0

    所以我找到了答案 . item()给我null,因为foreach参数没有正确解析,因此item()中没有任何内容 .

相关问题