Save a new value with entity_metadata_wrapper to an entity field which is an array I need to save a new value to a field on an entity and I was wondering if it was possible to use entity_metadata_wrapper or is it only possible to set an existing value?
When dealing with multi-value fields, the associated entity metadata wrapper object is an instance of EntityListWrapper (It may be a good idea to browse the API to look at the available methods. Also note this class implements the ArrayAccess interface)

So the simplest way to add new values to an EntityListWrapper is by using the "[]" operator:

$wrapper-&gt;field_example[] = $new_value;


This creates a new entry and assigns it the value. With this methods, the delta (the offset within the list of value) is created automatically. You can also set the offset yourself if you wish. Any of the three following methods are equivalent:

$wrapper-&gt;field_example[$delta] = $new_value;
$wrapper-&gt;field_example-&gt;offsetSet($delta, $new_value);
$wrapper-&gt;field_example-&gt;get($delta)-&gt;set($new_value);


In all three cases this will overwrite values if the delta already exists, and create a new entry if not.

You could also directly set an array of value on the field itself. Both of the methods are equivalent:

$value = array
  0 =&gt; array('property_example' =&gt; 'hello'),
  1 =&gt; array('property_example' =&gt; 'world')
);
$wrapper-&gt;field_example = $value;
$wrapper-&gt;field_example-&gt;set($value);


However this requires you to know the internal structure of the field you're assigning to as you're not using the field's metadata wrapper.

Finally you can empty a multi value field by setting it to an empty value. All three methods are equivalent :

$wrapper-&gt;field_example-&gt;set();
$wrapper-&gt;field_example = array();
$wrapper-&gt;field_example = NULL;