Create or Update Custom Metadata Type records from CSV file. Read more about this project.
This approach is recommended since all components will be deployed using a namespace, removing the chance of failures due to conflicting API names.
You can install this as an Unlocked Package, using the CLI, by running the following command:
sfdx force:package:install --package "04t1t000003LfYEAA0" --targetusername YOUR_ORG_ALIAS --wait 10 --publishwait 10
This approach is recommended since all components will be deployed using a namespace, removing the chance of failures due to conflicting API names.
You can install this by cloning the repository and deploying the content of cmd-loader folder. Before that you should remove the namespace property in the sfdx-project.json file.
"namespace": "spaghettiCMD"
After deploying the application follow these step to enable it for your users:
- Assign yourself, or ask your System Administrator to assign, the Custom Metadata Loader permission set to your user
- In the App Launcher search for Custom Metadata Loader tab
- Select the CSV file
- Select the Custom Metadata Type
- Click on Load Records button
- Checkbox
- Date, the specified string should use the standard date format “yyyy-MM-dd”.
- Datetime, the specified string should use the standard date format “yyyy-MM-dd HH:mm:ss” in the local time zone.
- Number
- Percent
- Phone
- Picklist
- Text
- Text Area, supports multiline text
- Text Area Long, supports multiline text
- URL
CSV columns must match the API name on your Custom Metadata Type fields. The CSV file must include these columns:
- DeveloperName, is the unique identifier for the record
- One between MasterLabel or Label, for the record's label
This application does not impose any hard limit on the CSV file size or number of rows but it is subjected to all Apex Governor Limit.
If your CSV file contains more than 250 rows the application will automatically split it into smaller chunks of 250 rows each. Chunks will be loaded sequentially.
For more complex use cases consider that the Salesforce CLI has a bunch of commands to work with Custom Metadata Types. Check them out here.
YouTube video:
If you are interested in contributing, please take a look at the CONTRIBUTING guide.
- Papa Parse for its amazing Javascript CSV parser