A semi-recent feature of salesforce is Custom Metadata Types. The are like custom settings, but better in many ways.

One of these is very important…  they are deployable! Just like any other piece of metadata (fields, objects, classes, etc) Anyone who has ever dealt with custom settings before, knows what a gigantic pain in the ass it is to keep environments in sync.

However, they have some limitations… While they can be accessed from within apex classes, unlike custom settings they cannot be modified programmatically (well, they can but its not that easy).

Also, unlike custom settings, there is no easy way to populate them in bulk (e.g via workbench, dataloader, etc). Salesforce do give you an option, but it kind of sucks (it involves deploying code to your org, etc, etc)

Faced with having to load ~200 custom metadata type records, and not wanting add an app to my org when I didn’t have to. I decided to write a tool instead.

Presenting: Meta Dataloader!

https://meta-dataloader.herokuapp.com/

This is a similar tool to SchemaPuker (infact, i reused a LOT of the code from it) that performs one specific task, it can take a CSV and create custom metadata type records from it.

Once you’ve logged in, you simply choose the Metadata type you wish to load records in to, and if you want to upsert or delete records.

screen-shot-2016-12-02-at-5-41-04-pm

You then need to upload a csv of the values you wish to load, with the headings matching the field API names (similar to workbench)

screen-shot-2016-12-02-at-5-44-27-pm

Click submit, and the records will be upserted or deleted

screen-shot-2016-12-02-at-5-38-28-pm

The tool is pretty basic, but it solves a problem. It took me ~3 hours to put together, so it may have issues.

If you find it useful, let me know, and likewise let me know if you find any bugs.

The code for this is available on my github

Leave a Reply

Your email address will not be published. Required fields are marked *