How to populate select field from View result like in In a custom content entity, I have defined this field  

$fields['from_seliste_id'] = BaseFieldDefinition::create('entity_reference')
  -&gt;setLabel(t('Offreur'))
  -&gt;setDescription(t('Le SÉListe qui a rendu le service (qui reçoit les graines)'))
  -&gt;setSetting('target_type', 'person')
  -&gt;setSetting('handler', 'views')
  -&gt;setSetting('handler_settings', [
    'view' =&gt; [
      'view_name' =&gt; 'sel_selistes',
      'display_name' =&gt; 'entity_reference_1',
    ],
  ])
  -&gt;setDisplayOptions('view', array(
    'weight' =&gt; $weight,
  ))
  -&gt;setDisplayOptions('form', array(
    'weight' =&gt; $weight,
    'type' =&gt; 'options_select',
  ))
  -&gt;setDisplayConfigurable('form', TRUE)
  -&gt;setDisplayConfigurable('view', TRUE)
  -&gt;setRequired(TRUE);


In the corresponding form, the field appears as wanted as a dropdown list populated with the result of the View sel_selistes:


I'd like to create another form with the same functionality.
How should I code the field in the form?  

$form['mySelectField'] = array(
  '#type' =&gt; 'select',
  '#options' =&gt; [], &lt;-- ??????
  '#title' =&gt; $this
    -&gt;t('whatever'),
);
I don't have time to provide an exact answer, but something along these lines. 

// Programmatically execute view
$view = views_get_view('sel_selistes'); //  view machine name
$view-&gt;set_display("entity_reference_1"); // view display name
// $view-&gt;set_arguments($arg) // looks like you don't have arguments.
$view-&gt;execute();

$view_results = []; // create array
// loop through results
foreach ($view-&gt;result as $row_id =&gt; $row) {
  // some php magic so you add to array like this $view_results[$nid_value] = $some_field_row_value;
}

$form['my_select_field'] = array(
  '#type' =&gt; 'select',
  '#options' =&gt; $view_results,
  '#title' =&gt; $this
    -&gt;t('whatever'),
);