Creating Custom Metadata Entries from CSV with SFDX:
Gaurav Gupta
Certified System Architect | Certified Application Architect | 19X Certified | Trainer | Double Ranger | Blogger
For administrators and developers, custom metadata holds immense power due to its simplicity during setup, providing a versatile tool for handling intricate Apex/Flow scenarios.
What if there was a method to generate metadata entries from a CSV file? Look no further than leveraging SFDX, Salesforce's command-line interface (CLI) tool.
Here's a step-by-step guide:
Please note: The metadata records are formed within your local Salesforce project folder, using the field definitions acquired in step 1.
?? Use the following command to create metadata records from CSV:
sfdx cmdt generate records --csv <path_to_csv_file> --type-name <Custom_Metadata_API_Name>
Pro Tip: Consider adopting 'sf' instead of 'sfdx' to future-proof your commands, as 'sfdx' may be deprecated in the future.
?? Explore the documentation for more details: Link to Documentation