How to programatically update existing user profile field in drupal 7 We are using Drupal 7 and the Profile2 module. 

We create and add a value to a field in the profile using this code:

$profile = profile_create(array('type' =&gt; 'main', 'uid' =&gt; $account-&gt;uid));
$lang = LANGUAGE_NONE;
$profile-&gt;field_headline[$lang][0]['value'] = 'Software Engg';
profile2_save($profile);


How can we programtically update the user profile field 'field_headline'?

Please advice us.
You just need to load the user using drupal function 

profile2_load_by_user($account-&gt;uid, $type_name = NULL)


$account-&gt;uid => user id

$type_name => one of the profile types of profile 2 if any otherwise NULL

   $profile =  profile2_load_by_user($account, $type_name = NULL)
   $profile-&gt;field_headline[$lang][0]['value'] = 'update Software Engg';
   profile2_save($profile);


For more information Click Here

Hope it will work for you!