The independent daily for Salesforce admins, developers and architects

Curated by Abhinav (opens in a new tab)

Checking a Contact export for orphans, duplicate External IDs and picklist mismatches after a load (opens in a new tab)

You will learn how to count orphaned Contacts, unresolved AccountIds, duplicate External IDs and picklist values outside the allowed API names, using spreadsheet formulas, a standard-library Python script and SOQL.

Why read this

The article also explains what these checks cannot catch.

  1. Export Contacts and Accounts
  2. Flag blank and unresolved AccountIds
  3. Find duplicate External IDs
  4. Compare picklist to allowed API names
Four checks run on the exported files after a load

A successful Data Loader insert or upsert can still leave a Contact export with problems the success file does not show. The article covers blank AccountIds, AccountIds that point to no Account in the export, External IDs shared by more than one Contact, and picklist values that are not among the field’s allowed API names.

The walkthrough works through example files and three methods: spreadsheet formulas that flag each problem column, a Python script using only the standard library, and SOQL queries to confirm the counts against the live org. It notes that SOQL returns picklist API names rather than labels, and that values loaded into an unrestricted picklist can be stored without being listed in Setup.

The author stresses that orphans are a review list rather than a delete list, and that a wrong but existing AccountId needs a separate source-to-target comparison. The example data is fabricated and the reader must adapt field headers to their own org.

Read the original at dev.to (opens in a new tab)

Worth reading?