简体   繁体   中英

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. 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:

CSV File

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:

@activity('TablesLookup').output.value

Inside the Foreach I have created a Copy Data activity which has Salesforce as data source .

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. But I didn't find the option where I can pass the table name . Details on the figures bellow:

Salesforce Dataset - Parameters

Salesforce Dataset - Connection

ForEach - Copy Data, Salesforce Data Source

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:

在此处输入图像描述

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM