How to restrict a field choice allowing only one to be populated?
A bit confusing because it is rare for me to attempt any coding.


For this example I will pretend the content type is "Article".

First go to manage fields, and add a new field of list (text) to your content type. Let's say the possible values are "video" and "image". So For allowed values list, put

image|image
video|video


In /themes/your_theme_name/your_theme_name.theme add the following

/**
 * Implements hook_form_FORM_ID_alter().
 */
function your_theme_name_form_node_article_edit_form_alter(&amp;$form, \Drupal\Core\Form\FormStateInterface &amp;$form_state, $form_id) {
  $form['field_image']['#states'] = [
    'visible' =&gt; [
      'select[name="field_select"]' =&gt; ['value' =&gt; 'image']
    ]
  ];
  $form['field_video']['#states'] = [
     'visible' =&gt; [
       'select[name="field_select"]' =&gt; ['value' =&gt; 'video']
    ]
  ];
}



Replace your_theme_name with your actual theme name.
Replace article with your actual content type name.
Replace field_select with the machine name of your select field. 
Replace field_image with the machine name of your image field. 
Replace field_video with the machine name of your video field. 


Lastly, clear and flush all cache to see changes. 

Source: Drupal 8 - Conditionally hide a form field