Documentation
@if-exist
usage
<CREATE>
<CONTACT if-exist="replace/skip/fill">
...
</CONTACT>
</CREATE>
When manipulating Contacts - that are supposed to be uniquely identified by their emails - it can be a bit of additional work to check first the existence of the Contact, and only then replace their datas.
Nectil includes an operator that allows to express which action should be taken if a Contact with the same Email already exists.
This way, you can process the operation in one NQL command instead of two.
The three possible actions are the following :
- replace : if the contact already exists, Nectil will replace its current informations with the now one.
- fill : if the contact already exists, Nectil will only fill the fields that are blank and leave the other fields unchanged.
- skip : if the contact already exists, no action is taken.
If replace or fill is set, the command will execute as an UPDATE on the Contact with the same email.
If you provided DEPENDENCIES, CATEGORIES or DESCRIPTIONS, they will be managed as if it was an UPDATE on the Contact.
If skip is set, nothing will be done, you will simply receive an error message.
exemples
<CREATE>
<CONTACT if-exist="replace">
<INFO>
<EMAIL1>james@nectil.com</EMAIL1>
<ADDRESS>61, rue des mimosas</ADDRESS>
<POSTALCODE>1000</POSTALCODE>
<CITY>Bruxelles</CITY>
</INFO>
</CONTACT>
</CREATE>
<CREATE>
<CONTACT if-exist="fill">
<INFO>
<EMAIL1>james@nectil.com</EMAIL1>
<PURPOSE>Marketing Executive</PURPOSE>
</INFO>
</CONTACT>
</CREATE>