Answers.Body: <p>First create a custom field of type select or multi-select with empty options. From civicrm_custom_field table grab the option_group_id for the field.</p>
  <p>You can use <a href="https://civicrm.org/extensions/option-value-importer" rel="nofollow noreferrer">Option value importer</a> extension to import all the options using csv or have a insert query to insert records in civicrm_option_value table using option_group_id from civicrm_custom_field.option_group_id</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-29T15:40:53.123Z
Answers.Text: Thanks! I'll try that.
Answers.UserDisplayName: Jon Griffin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-28T17:50:59.543Z
Answers.LastActivityDate: 2021-03-28T17:50:59.543Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>New install (civicrm 5.35.1) and I can't find this answer.</p>
  <p>We have 22,000 alumni that I've imported. One of the fields is cast year there are about 120 of these so I want to make an option group (it would be taxonomy in other systems I guess). There are multiple uses of this in a contact.</p>
  <p>For example, everyone of our alumni has a primary cast. They could also have multiple &quot;secondary&quot; casts where they were staff or several other participants.</p>
  <p>I'm trying to map these to a contact through a custom field.</p>
  <p>Data sample:</p>
  <pre><code>1965A
  1965B
  1988E
  </code></pre>
  <p>etc.</p>
  <p>Question 1: I can import the data into the database directly if needed, but I'm not sure of all the fields that are listed in the option group table.</p>
  <p>Question 2: Assuming I get these entered as an option group, how can I create a custom field that will use this for lookup? And secondarily, how to choose which cast type it is (i.e. primary, secondary, etc.)</p>
  <p>In answer to the 2nd part of question 2, I know I can also create an option group of cast_type, but again, I'm not finding an easy way to have this show and also allow me to import it. It would be similar to phone or address I imagine.</p>
  <p>Thanks and please let me know if you have an questions.</p>
  
Tags: <custom-fields><option>
Title: Option Group vs Custom field
ThreadText: # Option Group vs Custom field
  
  (Asked by: username_0 on 2021-03-28)
  
  New install (civicrm 5.35.1) and I can't find this answer.
  
  We have 22,000 alumni that I've imported. One of the fields is cast year there are about 120 of these so I want to make an option group (it would be taxonomy in other systems I guess). There are multiple uses of this in a contact.
  
  For example, everyone of our alumni has a primary cast. They could also have multiple "secondary" casts where they were staff or several other participants.
  
  I'm trying to map these to a contact through a custom field.
  
  Data sample:
  
  ```
  1965A
  1965B
  1988E
  
  ```
  
  etc.
  
  Question 1: I can import the data into the database directly if needed, but I'm not sure of all the fields that are listed in the option group table.
  
  Question 2: Assuming I get these entered as an option group, how can I create a custom field that will use this for lookup? And secondarily, how to choose which cast type it is (i.e. primary, secondary, etc.)
  
  In answer to the 2nd part of question 2, I know I can also create an option group of cast\_type, but again, I'm not finding an easy way to have this show and also allow me to import it. It would be similar to phone or address I imagine.
  
  Thanks and please let me know if you have an questions.
  
  **Tags:** custom-fields, option
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-03-28. Score: 1
  
  First create a custom field of type select or multi-select with empty options. From civicrm\_custom\_field table grab the option\_group\_id for the field.
  
  You can use [Option value importer](https://civicrm.org/extensions/option-value-importer) extension to import all the options using csv or have a insert query to insert records in civicrm\_option\_value table using option\_group\_id from civicrm\_custom\_field.option\_group\_id
  
  > **Comments:**
  > **username_0**: Thanks! I'll try that.  
  
  ---
  
  