How to programmatically add default values to existing nodes of a specific content type On a Drupal 7 site, I have a content type that is populated with existing nodes. Later, I added a new boolean field (that is required). The existing nodes now have a blank value for this field. 

How do I programmatically populate these nodes with a default value?
You may use module Views Bulk Operation. Then create views page like table and field title, your field, add field Content: Bulk operations (Bulk operations) with settings VIEWS BULK OPERATIONS -> SELECTED OPERATIONS Execute arbitrary PHP script (views_bulk_operations_script_action). Save, Open the page, select one node, choose Execute arbitrary PHP script

enter next code and execute:

//change entity title or what you want to do
$entity -&gt; title = $entity-&gt;title . ' test';

//save entity
entity_save('node', $entity);