Updating empty fields via the Webservices


In the normal addemar behaviour it is not possible to update your contacts with empty fields. This is as designed, to protect the overwrite of empty fields ( which for example are used by personalisation in emails. ).

However for certain fields you'll need to do this. We have integrated on override via de Webservices call updateContact.

updateContact (ContactData $contact_data, [string $log_msg = ''])
  • return: boolean (true=successful, false=unsuccessful)

The argument is the ContactData structure.

Example:

$contact_data = $sClient->getContactData(1);
$contact_data->fields[1]->value = "firstname";
$contact_data->fields[2]->value = "lastname";
$result = $sClient->updateContact($contact_data,"test");
 
If you want to update empty fields, you need to pass this logmessage parameter #UpdateEmptyFields#.
 
This will update all the fields you have send through also, the empty fields.