cmdt generate records
Generate new custom metadata type records from a CSV file.
The custom metadata type must already exist in your project. By default, the Name column is used to determine the record name; use the –name-column flag to specify a different column.
force:cmdt:record:insert
cmdt:record:insert
| Flag Name (Long) | Flag Name (Short) | Description |
|---|---|---|
‑‑csv | ‑f | Type: Value Required Pathname of the CSV file. |
‑‑flags‑dir | N/A | Type: Value Import flag values from a directory. |
‑‑input‑directory | ‑i | Type: Value Default value: force-app/main/default/objectsDirectory from which to get the custom metadata type definition from. |
‑‑json | N/A | Type: Boolean Format output as json. |
‑‑name‑column | ‑n | Type: Value Default value: NameColumn used to determine the name of the record. |
‑‑output‑directory | ‑d | Type: Value Default value: force-app/main/default/customMetadataDirectory to store newly-created custom metadata record files. |
‑‑type‑name | ‑t | Type: Value Required API name of the custom metadata type to create a record for. The ‘__mdt’ suffix is appended to the end of the name if it’s omitted. |
Generate record metadata files from values in a CSV file for the custom metadata type MyCmdt. Use ‘Name’ as the column that specifies the record name:
Generate record metadata files from a CSV file in the directory different from the default, and use ‘PrimaryKey’ as the column that specifies the record name: