There is the Preferred language field in Communication Preferences which allows to choose the contact's preferred language.

However when I try to create custom fields for a contact's second, third language, I don't find Language as a choice among the other Data and Input Field Types What would be the recommended way to make the language select like in Preferred language available for re-use in custom fields?

With all the languages in a select field defined and available somewhere, what I try to avoid here is that I need to re-enter all these languages by hand for my custom fields.

3 Answers 3


I had this need today, and wrote a general version of the extension @ñull wrote above. This lets anyone take advantage of this feature without knowing how to code: https://lab.civicrm.org/extensions/languagecustomfield


In CiviCRM, custom fields have the ability to re-use options from another custom field, but not from a core field like Preferred Language. So this is not currently possible via the UI.

2 Solutions come to mind, both using small amounts of custom code:

  1. Write a short script that uses the api to fetch all languages and then copy them into the options of one of your custom fields. Then re-use those same options in 3rd, 4th language fields.

  2. Write a tiny extension that implements hook_civicrm_customFieldOptions and populates those options dynamically by outputting the languages in the system.


My solution for this was to

  1. Setup Field with Alphanumeric and Select Properties, assigning it to any existing option set.
  2. Directly in the Database: Find Table: "civicrm_option_group" In that table find the option group you are trying to use (e.e: Languages). Take note of that row's "id".
  3. Directly in the Database: Find Table: "civicrm_custom_field" In that field find the field you created in Step 1.
  4. In the row of that field, edit the column: "option_group_id" to the id number you notated in Step 2.

This worked for me when trying to use the Languages list.

  • In some ways I like this solution better than my own. I might update my extension to use this method. The advantage is that you can uninstall the extension and it will continue to work. There's a theoretical performance boost too, but it's a minimal difference. Jan 29, 2020 at 20:30

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.