I am creating an extension. I created a custom group and custom field. The data and input field type is alphanumeric and select. I want to add multiple choice option into that custom field using an extension. enter image description here


You can use managed hook to create custom field on install

  1. Create Option Group 2.Create option values for option group
  2. Create custom group
  3. Create custom field.

There is another way of doing this i.e by creating xml file. A good example to refer would be https://github.com/compucorp/civihr/blob/master/hrcareer/xml/auto_install.xml



  • How to set values to the custom field using API?
    – Dipak Giri
    Dec 13 '18 at 11:20

It sounds like you are looking for this hook: https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_fieldOptions/

It lets you set the values in the select dropdown on-the-fly.

  • How to add values for the custom field using API explorer v3? (support -> Developer ->API explorer v3).
    – Dipak Giri
    Dec 14 '18 at 6:07
  • I saw documentation but not understood. Please give some example.
    – Dipak Giri
    Dec 14 '18 at 9:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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