Save and Update Custom Metadata Records Using Flow
Jonathan Gillespie created a nifty action that lets you Create and Update Custom Metadata records from within Flow – something not possible out of the box. Check it out over at his GitHub account: https://github.com/jongpie/CustomMetadataSaver
When do you use Custom Metadata?
Custom Metadata is an extremely powerful feature that lets you control core logic from code and automations declaratively. Here is a great article/video from 2018’s Dreamforce that shows how you can utilize Custom Metadata in Flow and when you should use it: https://admin.salesforce.com/blog/2018/advanced-automation-with-flows-and-custom-metadata-types-webinar-recap
From the article – Use Custom Metadata when:
- Application or Org data are referenced in multiple places in your org
- Manage mappings like a ‘State → Tax Rate’ or the DeveloperName/Email address of a specific user/Group
- Manage information that is subject to change or will change frequently
- Store frequently used text like a task descriptions, chatter description, or notification contents
- Store environment variables (URLs, things specific to each Salesforce environment)*
I can see two key use cases for this action:
- Giving power users and key decision makers the ability to control business logic without admin intervention and without giving them ‘Customize Application’ access.
- Creating custom metadata records with complex logic – perhaps based on record data
For mass-creating CMT records from Flow from a CSV file I recommend trying Narender Singh’s action posted last week.
Install & Setup
To install, use the ‘Deploy to Salesforce’ button in the README section of the repo. NOTE: Jonathan is working on email alert notifications for when the deploy succeeds or fails: https://github.com/jongpie/CustomMetadataSaver/pull/9
Check out a video of it in action