Populating select list from a taxonomy term field I'm trying to populate a select list dynamically by pulling its values from a taxonomy term field linked to the current-user account. Just to clarify, below function is a hook defined by a module that came with a custom installation profile. It is basically used to create fields on a specific form.
So, my custom module has-

function some_function_attributes() {


      global $user;
      $user_fields = user_load($user-&gt;uid);
      $termid = $user_fields-&gt;field_user_organization['und']['0']['tid'];
      $taxonomy_term = taxonomy_term_load($termid);
      //dsm($taxonomy_term);
      $options = field_get_items('taxonomy_term', $taxonomy_term, 'field_org_environment','select');
      dsm($options);
      return array(
        'environment' =&gt; array(
        'type' =&gt; 'select',
        'options' =&gt; $options,
        'name' =&gt; t('Environment'),
        )
      );
    }




Allowed values in the field (for this user)- 

E1|Env1

E2|Env2



Here's the devel screenshot for dsm($options);


So, its populating the right field but not in the way it should.



Actual form element looks like this-


Currently, its just returning the array and I can't figure out what I missed. Been banging my head to the wall for this- 
How would I populate Env1 and Env2 in this select-list ?
You'll have to reformat the options array to be in the form 'return value' =&gt; 'display value'. See https://api.drupal.org/api/drupal/developer%21topics%21forms_api_reference.html/7.x#options