16

Can Custom Metadata be mass inserted?

My Custom Metadata Type is listed as a custom object in the Data Import Wizard but when I -

  1. select the object
  2. add new records
  3. choose the CSV file
  4. next

none of the fields are mapped and when I click Map an error's displayed

Something has gone wrong. Cannot read property 'length' of undefined. Please try again.

The Metadata Type is listed in Workbench for SOQL queries but not when I try to use it's insert function. It's not listed in the list of Dataloader objects.

2 Answers 2

15

The Data Loader, as far as I can tell, does not support Custom Metadata (and we've been given no indication if this will be available in the future). In fact, custom metadata isn't "real" data, and is actually documented in the Metadata API documentation. You could choose to use Ant and build the appropriate files that way, or you can follow the other instructions for simply loading this metadata.


Summer '20 Update

The Salesforce DX CLI can now import these records using the cmdt command. This is the recommended approach. The older tools are still technically viable, but should only be used if you somehow can't use Salesforce DX.


Previous answer:

In the implementation manual, the guide tells you how to import custom metadata:

Edit: The older version, included below in the original quote, has been deprecated. Please use this version instead. It also now includes a Deploy to Salesforce button to make it easier to deploy in fewer steps.


(Page 13)

Use the custom metadata loader to bulk load records to your custom metadata types from a .csv file. The custom metadata loader lets you load up to 200 records with a single call.

  1. Download the tool from GitHub. Deploy the package to your org via Workbench. Note that you have to create a .zip file of the contents of the custom_md_loader directory instead of zipping up the directory itself.
  2. Create a .csv file with a header that contains the custom metadata type’s field API names. Either the Label field or the Developer Name field is required. See sample.csv in your download for an example. If your org is namespaced, be sure to include the namespace prefix in your header.
  3. From Setup, assign the Custom Metadata Loader permission set to the appropriate users, including yourself.
  4. Select Custom Metadata Loader from the App Picker.
  5. Go to the Custom Metadata Loader tab. The app prompts you to configure your Remote Site Settings if you haven’t already done so.
  6. Select your .csv file and the corresponding custom metadata type.
  7. Click Create custom metadata to bulk load the records from the .csv file.
7
  • 2
    The linked tool is deprecated (04/04/18). There is a supported Salesforce version of the tool on Github
    – Dizzley
    Apr 4, 2018 at 10:26
  • 1
    @Dizzley The documentation hasn't been updated yet to reflect this change, apparently, but I can update this answer with this link, since the overall instructions appear to be nearly identical at this point.
    – sfdcfox
    Apr 4, 2018 at 10:47
  • Well done @sfdcfox. I just stumbled on it today. Your answer was very helpful. I got the official tool to work as expected.
    – Dizzley
    Apr 4, 2018 at 14:29
  • How do you get this to work on an org that is not a developer org? The instructions say to add in the org namespace, and I am trying to follow the directions, but it doesn't have the edit option, and says we need a developer org. SELECT NamespacePrefix FROM Organization yields nothing.
    – Chance
    Aug 28, 2018 at 16:18
  • 1
    As of version 49.0 this github tool isn't needed anymore (the tool readme also mentions it) because now bulk upload CMD records are supported through CLI commands.developer.salesforce.com/docs/… Nov 12, 2020 at 13:24
2

If you want, can use a tool I has developed https://github.com/OscarIuliano/ProfiliSFDC

It can help you ti add massive permissione in your profile, or create massive custommetadata in your repository.

At this link you can find a Cloud version to upload massive custom metadata type.

http://www.sfdccloudloader.com/

1
  • thank you for the tool, it works -- however, as a respectful suggestion, the custom login where I type my password + token into your UI is not ideal since I don't have a guarantee you're not storing it. I suggest you update it to use a proper oAuth authentication. Jul 7 at 19:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .