@Umair Ehsan Since you're writing data from Azure SQL into Salesforce using ADF and then want to fetch those newly inserted records (along with their Salesforce-generated IDs) right after the insert, here’s a practical approach you can try within the same pipeline:
Use an External ID – When pushing data into Salesforce, it helps if you're passing a unique value from your SQL source (like a primary key). This can be used later to identify exactly what was inserted.
Add a Follow-up Lookup or Copy Activity – After the insert step, add a step that queries Salesforce (using SOQL) to pull back those same records based on the external IDs. This way, you can get the Salesforce record IDs and any other fields you need. Something like:
Copy
SELECT Id, External_Id__c FROM YourObject WHERE External_Id__c IN ('your-key-values')
Optional: Store or log these records – You can store the results in a SQL or blob sink, especially if you need them for backfill or reconciliation later.
If your load volume is high, instead of directly using external IDs, you can implement a watermark pattern based on CreatedDate
, filtering records inserted in the last few minutes (e.g., CreatedDate >= @{pipeline().TriggerTime}
minus buffer).
Hope this helps. If this answers your query, do click Accept Answer
and Yes
for was this answer helpful. And, if you have any further query do let us know.