Answers.Body: <p>Are you trying to add these in an extension?  If so, see <a href="https://docs.civicrm.org/dev/en/latest/extensions/civix/#add-custom-fields" rel="nofollow noreferrer">adding custom fields with civix</a> which suggests creating them via the GUI then exporting them.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-12T10:47:36.780Z
Answers.LastActivityDate: 2019-02-12T10:47:36.780Z
Answers.UserDisplayName: Aidan
Body: <p>I'm trying to create an option group for a custom data field.  It needs to be a multi-select dropdown. How can I build in CiviCRM</p>
  
  <p>Eg</p>
  
  <pre><code>&lt;select&gt;
    &lt;optgroup label="Accommodations"&gt;
      &lt;option value="Bed &amp; Breakfasts"&gt;Bed &amp;amp; Breakfasts&lt;/option&gt;
      &lt;option value="Camping"&gt;Camping&lt;/option&gt;
    &lt;/optgroup&gt;
    &lt;optgroup label="Arts &amp; Crafts"&gt;
      &lt;option value="Artisans"&gt;Artisans&lt;/option&gt;
      &lt;option value="Artists"&gt;Artists&lt;/option&gt;
    &lt;/optgroup&gt;
  &lt;/select&gt;
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-12T19:39:49.310Z
Comments.Text: agree with Aidan - can you clarify why just adding these via Custom Field isn't an option. mostly folk would 'add custom field' and within that choose eg 'select' and then create their options
Comments.UserDisplayName: petednz - fuzion
Tags: <custom-fields>
Title: How can I add Option Group for custom data field in CiviCRM
ThreadText: # How can I add Option Group for custom data field in CiviCRM
  
  (Asked by: username_0 on 2019-02-12)
  
  I'm trying to create an option group for a custom data field.  It needs to be a multi-select dropdown. How can I build in CiviCRM
  Eg
  
    
      Bed & Breakfasts
      Camping
    
    
      Artisans
      Artists
  
  **Tags:** custom-fields
  
  > **Comments:**
  > **username_1**: agree with username_2 - can you clarify why just adding these via Custom Field isn't an option. mostly folk would 'add custom field' and within that choose eg 'select' and then create their options  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-02-12. Score: 1
  
  Are you trying to add these in an extension? If so, see [adding custom fields with civix](https://docs.civicrm.org/dev/en/latest/extensions/civix/#add-custom-fields) which suggests creating them via the GUI then exporting them.
  
  
  ---
  
  