[英]Azure Data Factory Pass “Object api name” of Salesforce Tables as Parameter from ForEach
I trying to load some tables from Salesforce , the number of tables can change from time to time.我试图从Salesforce加载一些表,表的数量可能会不时改变。 We created a CSV file on a blob storage which contains the name of tables that we want to load from Salesforce, this CSV contains one column as shown bellow:
我们在 blob 存储上创建了 CSV 文件,其中包含我们要从 Salesforce 加载的表的名称,此 CSV 包含一列,如下所示:
I have created a Lookup activity that refers to the CSV file (and I disabled the option of First row only), then I connected it to a ForEach activity which iterates over each row of the Lookup activity , as shown bellow:我创建了一个引用 CSV 文件的Lookup 活动(并且我只禁用了 First row 的选项),然后我将它连接到一个ForEach 活动,该活动遍历Lookup 活动的每一行,如下所示:
@activity('TablesLookup').output.value
Inside the Foreach I have created a Copy Data activity which has Salesforce as data source .在 Foreach 内部,我创建了一个复制数据活动,其中Salesforce 作为数据源。
The problem here is that I'm trying to pass the table name of the Salesforce data source (the Object api name ) as a parameter from the ForEach.这里的问题是我试图将 Salesforce 数据源的表名( Object api 名称)作为 ForEach 的参数传递。 But I didn't find the option where I can pass the table name .
但是我没有找到可以传递 table name的选项。 Details on the figures bellow:
下图的详细信息:
Salesforce Dataset - Parameters Salesforce 数据集 - 参数
Salesforce Dataset - Connection Salesforce 数据集 - 连接
ForEach - Copy Data, Salesforce Data Source ForEach - 复制数据,Salesforce 数据源
This gives me an the following error:这给了我以下错误:
ErrorCode=UserErrorOdbcOperationFailed,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=ERROR [HY000] [Microsoft][Salesforce] (120) SOQL_FIRST mode prepare failure: SOQL error: [Microsoft][SQLEngine] (31480) syntax error near 'SELECT *<<< ??? >>> FROM "Student"'. SQL error: [Microsoft][SQLEngine] (31740) Table or view not found: Deloitte..Student,Source=Microsoft.DataTransfer.ClientLibrary.Odbc.OdbcConnector,''Type=System.Data.Odbc.OdbcException,Message=ERROR [HY000] [Microsoft][Salesforce] (120) SOQL_FIRST mode prepare failure: SOQL error: [Microsoft][SQLEngine] (31480) syntax error near 'SELECT *<<< ??? >>> FROM "Student"'. SQL error: [Microsoft][SQLEngine] (31740) Table or view not found: Deloitte..Student,Source=Microsoft Salesforce ODBC Driver,'
Best regards,此致,
If your Lookup activity's output is like this:如果您的 Lookup 活动的 output 是这样的:
You need to change @item()
to @item().Names
when you pass your value of Table Name from Look up activity's output to parameter named 'tableName' in dataset(In 'ForEach - Copy Data, Salesforce Data Source' step).当您将表名称的值从查找活动的 output 传递到数据集中名为“tableName”的参数时,您需要将
@item()
更改为@item().Names
(在“ForEach - 复制数据,Salesforce 数据源”步骤中) .
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.