In Salesforce, you cannot directly mass insert Custom Metadata Type (CMDT) records using normal data tools like Data Loader or Data Import Wizard. This is mainly due to how Salesforce treats Custom Metadata.
1. Custom Metadata is considered Metadata, not Data
Custom Metadata records are stored as metadata configuration, similar to objects, fields, and workflows.
Because of this, Salesforce expects them to be deployed through metadata deployment tools, not data tools.
2. They are packageable and deployable
- Custom Metadata is designed to be moved between orgs (Dev → Test → Prod).
- Allowing normal bulk inserts could break the configuration consistency between environments.
3. Limited CRUD operations
- You cannot insert/update/delete CMDT records using standard DML in Apex (except with the Metadata API).
- Only read operations are allowed normally.
4. Supported ways to insert multiple CMDT records
You can mass-create them using:
- Metadata API (recommended for bulk)
- Apex Metadata API
- Deployment via Change Sets or Packages
- SFDX / Salesforce CLI deployment
- Workbench → Metadata API
Example approaches
- Deploy a CSV converted into metadata XML
- Use the SFDX command to deploy CMDT records
- Use the Apex Metadata API for runtime creation
Using SalesforceDX CLI:
https://sfdclesson.com/2021/02/20/mass-insert-custom-metadata-type-records/
Using External Tool:
https://www.packmagix.com/#