0

My question is; When you create a custom option list in Webforms, where or how does the list get stored?

Explanation: In the Webforms Module (8.x-5.0-rc13) you have the ability to create custom options lists. The Options configuration page lists reusable predefined options/values available for select menus, radio buttons, checkboxes and Likert elements. (example: gender, sizes). The option lists that are included when the module is installed can be found as a yml files in docroot>>modules>>webform>>config>>install. After creating a custom option list I can not find the files anywhere or find a table in the database with the vales.

WHY? I have a list of 500 colleges that I want to populate a select list with different option values option text. pasting the list would be much easier and faster than using the interface to create the list.

I tried using a term select but cannot figure out how to define the value. I can only define the display text in the terms.

Sample yml code customized from one of the predefined option lists:

langcode: en
status: true
dependencies:
  enforced:
    module:
      - webform
id: my_colleges
label: US Colleges
category: Demographic
likert: false
options: |
  361623: ALASKA PACIFIC UNIVERSITY
  362001: ANCHORAGE COMMUNITY COLLEGE
  362503: UNIVERSITY ALASKA
  362814: SHELDON JACKSON COLLEGE
  363495: UNIVERSITY ALASKA
3
  • This is stored in configuration, go to /admin/config/development/configuration/single/export and select the configuration type "Webform options" or export all config files and look for webform.webform_options.[id].yml
    – 4uk4
    Commented Jun 18, 2018 at 15:56
  • I cannot find the path you are referring to. I am using 8.x-5.0-rc13. I can find the files with webform.webform_options.[id].yml but only for the predefined option lists. the folder does not contain the created options list. ANd if you place a custom yml file in the directory, the list does not display.
    – Dan Wenk
    Commented Jun 18, 2018 at 16:52
  • The path is a url: www.mysite.com/admin/config/development/configuration/single/export (you can also navigate to it in the admin ui)
    – 4uk4
    Commented Jun 18, 2018 at 17:04

1 Answer 1

1

Webform options are config entities. You can export and import then via /admin/config/development/configuration.

You can also just bulk edit the options YAML. (/admin/structure/webform/config/options/manage/time_zones/source)

Or you can use hook_webform_options_alter() or hook_webform_options_WEBFORM_OPTIONS_ID_alter() to dynamic populate options from database or web service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.