Programmatically create user and add complete address field values I have an address field on my User entities.  I want to programmatically create users and set their address field values, I currently have this:

 $values = [
  'mail' =&gt; 'chris+7asd7fadf7afdafasdf@example.com',
  'name' =&gt; 'chris+7asd7fadf7afdafasdf@example',
  'first_name' =&gt; 'First',
  'last_name' =&gt; 'Last',
  'roles' =&gt; [],
  'pass' =&gt; user_password(),
  'status' =&gt; 1,
];
$user = User::create($values);
$user-&gt;field_contact_information-&gt;country = 'US';
$user-&gt;field_contact_information-&gt;given_name = $values['first_name'];
$user-&gt;field_contact_information-&gt;family_name = $values['last_name'];
$user-&gt;save();


But it's not saving the values to field_contact_information.  Elsewhere in the app, I do access these values with $user-&gt;field_contact_information-&gt;given_name.
That was simple - it should be $user-&gt;field_contact_information-&gt;country_code = 'US';