Hi ,
Thanks for reaching out to Microsoft Q&A.
The Copy activity using Salesforce V2 may implicitly filter records:
- Only Active records (i.e.,
IsDeleted = false
) may be included. - SystemModStamp or LastModifiedDate filtering is applied if incremental loading is enabled.
- Some lookup or relationship objects behave differently when queried via Copy activity. You can check for any default or explicit filters set in the Source settings or mapping.
Query Scope in SOQL (Web Activity)
Your SOQL query in Web activity might be --> SELECT COUNT(Id) FROM Account
This counts all visible records to the user running the query, which could include:
Archived or deleted records (in Recycle Bin)
Records that do not meet Copy activity's internal filters
Records that are accessible only due to sharing rules or admin privileges
Try adding a WHERE IsDeleted = FALSE
to your SOQL to match Copy activity behavior more closely --> SELECT COUNT(Id) FROM Account WHERE IsDeleted = FALSE
Copy Activity May Omit Certain Records
Depending on the object type (standard vs custom), API version, and selected fields, Copy activity may skip:
Records with nulls in required fields
Unreachable fields due to field-level security
Fields requiring special permissions (e.g., formula fields, lookup fields)
API Limitations and Pagination
Salesforce imposes batch limits (default 2000 records per batch), and ADF handles this with pagination internally. If the Copy activity:
- Hits a timeout or fails to paginate completely (rare)
- Has a schema mismatch
- Is using SOQL with LIMIT or WHERE conditions ->this may return few records
Best method to Get Accurate Row Count with Salesforce V2 Connector:
To align your row counts:
- Use the Web activity with filtered SOQL -> SELECT COUNT(Id) FROM Account WHERE IsDeleted = FALSE
- Alternatively, use a Copy activity with a derived column (ex:
RowNumber
) and then aggregate using Data Flow, but this is less efficient.
Enable logging and diagnostics on both activities and check:
Exact query being executed
Any skipped rows due to schema mapping or errors
Use Salesforce Workbench or Developer Console to validate expected count independently.
Please 'Upvote'(Thumbs-up) and 'Accept' as answer if the reply was helpful. This will be benefitting other community members who face the same issue.