How do I programmatically populate a field if another one is empty?
Create a custom module, in mymodule.module use hook_node_update

function mymodule_node_update($node) {

  if (!isset($node-&gt;field_example[LANGUAGE_NONE][0]['value'])) { 
  // If field example is not set (is empty), then...

     $new_value = // ...do some stuff to compute a new value for the field.
     $node-&gt;field_example2[LANGUAGE_NONE][0]['value'] = $new_value;
     field_attach_update('node', $node);

  }

}