gpt4 book ai didi

Azure数据工厂上传到Salesforce并引用另一个对象上的字段

转载 作者:行者123 更新时间:2023-12-05 02:14:25 25 4
gpt4 key购买 nike

这是这样的场景 - 我们正在使用 Azure DataFactoryV2 运行一系列管道,这些管道从本地数据源获取帐户数据,对其进行转换并上传到 Salesforce。

目前我们想要导入一个帐户并将其与另一个帐户关联。帐户存在标准的父/子关系(例如经销商帐户和子帐户),并且使用内部 Salesforce ID。

我们还使用外部 ID 来进行更新插入,并且该 ID 对于每条记录都是唯一的。

根据 SF 文档:Here - 当您手动调用 API 并向其传递 JSON 文件时,您可以在 JSON 中添加关系:

    {
"Name" : "NewAccount",
"account__r" :
{
"Ext_UID__c" : 123
}

}

但是,这在 Azure DataFactoryV2 中似乎无法在代码中指定查找关系,或者如果可以,我不确定如何执行。

供引用 - 这是管道 JSON 代码:

{
"name": "Import_to_Salesforce",
"properties": {
"activities": [
{
"name": "Load_to_Salesforce",
"type": "Copy",
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [
{
"name": "Source",
"value": "[dbo].[Account]"
},
{
"name": "Destination",
"value": "Account"
}
],
"typeProperties": {
"source": {
"type": "SqlSource"
},
"sink": {
"type": "SalesforceSink",
"writeBatchSize": 5000,
"writeBehavior": "upsert",
"externalIdFieldName": "Ext_UID__c",
"ignoreNullValues": false
},
"enableStaging": false,
"enableSkipIncompatibleRow": true,
"dataIntegrationUnits": 0,
"translator": {
"type": "TabularTranslator",
"columnMappings": {
"Name": "Name",
"ParentId": "ParentId",
"BillingStreet": "BillingStreet",
"BillingCity": "BillingCity",
"BillingPostalCode": "BillingPostalCode",
"BillingCountry": "BillingCountry",
"ShippingStreet": "ShippingStreet",
"ShippingCity": "ShippingCity",
"ShippingPostalCode": "ShippingPostalCode",
"ShippingCountry": "ShippingCountry",
"Phone": "Phone",
"AccountNumber": "AccountNumber",
"Brand__c": "Brand__c",
"Account_Status__c": "Account_Status__c",
"Account_Type__c": "Account_Type__c",
"Preferred_Payment_Method__c": "Preferred_Payment_Method__c",
"Last_Account_Login__c": "Last_Account_Login__c",
"Ext_UID__c": "Ext_UID__c",
"Auto_Renew_Status__c": "Auto_Renew_Status__c",
"Account_Balance__c": "Account_Balance__c",
"Outstanding_Amount_30_days__c": "Outstanding_Amount_30_days__c",
"Outstanding_Amount_60_days__c": "Outstanding_Amount_60_days__c",
"Outstanding_Amount_90_days__c": "Outstanding_Amount_90_days__c",
"Account_Priority__c": "Account_Priority__c",
"Reseller__c": "Reseller__c",
"Last_Payment__c": "Last_Payment__c"
}
}
},
"inputs": [
{
"referenceName": "Staging_Source",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "Destination_Load_to_Salesforce",
"type": "DatasetReference"
}
]
}
]
},
"type": "Microsoft.DataFactory/factories/pipelines"}

任何意见都将不胜感激。

最佳答案

您使用的是哪种 SF 连接器?如果没有有意义的名称,请查看您的 API 用户在 Salesforce 中的登录历史记录。它可能被列为“Simba Technologies”或类似的名称?

对于标准关系,您应该只需键入 Account.Ext_UID__c Parent.Ext_UID__c,就像在此联系人加载中一样:

enter image description here

对于自定义查找/主从字段,如果字段 API 名称为 Account__c,您可以将其映射为 Account__r.Ext_UID__c 以进行更新插入。

只需确保父帐户在子帐户引用它们之前存在...也许您在上一个作业中加载了它们,也许最好分两个阶段加载:

  1. 在没有映射父级的情况下对所有帐户进行平面插入/更新插入
  2. 重新父级更新/更新插入,仅映射此记录的分机 ID 和父级的分机。 id

关于Azure数据工厂上传到Salesforce并引用另一个对象上的字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53623673/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com