By sergio17gf on
Hello everyone,
I'm currently working on a project in Drupal 10 and I need to create a text list field. However, the list I want to input is quite extensive, and manually entering each item is time-consuming. I was wondering if there's a way to create a text list field by simply pasting a list of text, rather than adding each item one by one?
Any insights or suggestions on how to achieve this efficiently would be greatly appreciated.
Thank you!
Comments
You can export the field
You can export the field storage configuration, edit it and add allowed values. After that you can import it back.
1. Visit /admin/config/development/configuration/single/export
2. Select the "Field storage" from the "Configuration type" listbox.
3. Selects the configuration name from the "Configuration name".
4. Add allowed values below the "allowed_values" key.
5. Copy the code of the configuration.
6. Visit /admin/config/development/configuration/single/import
7. Select the "Field storage" from the "Configuration type" listbox.
8. Paste the code of the configuration to the "Paste your configuration here" field.
9. Click on the "Import button" button.
It is also possible to get allowed values from a file and add them using "allowed_values_function", see "Dynamic Defaults and Allowed Values for List Boxes in Drupal 8".