Add, Update and Upsert Attributes

You can use attributes to set or look up custom field values when adding, updating and upserting objects using the XML API or SOAP API.

The following table lists the supported attributes, and for each attribute, the XML API commands and SOAP API commands that support the attribute if it can only be used for specific operations.

Attribute

XML API Commands

SOAP API Commands

Usage

enable_custom

Add

CreateUser

Modify

ModifyOnCondition

Set the enable_custom attribute to 1 to include custom field values in the argument object properties inline with standard object properties.

Custom field values can be included in the argument object properties by default when using the SOAP API. Use the account-specific WSDL.

lookup

Add

CreateUser

upsert()

Use the lookup to upsert an object and designate the lookup field. The lookup field determines whether it adds or updates an object:

  • If the lookup field is not matched in any existing objects, a new object is added.

  • If the lookup field is matched one time, the existing object is updated.

Sample codes:

lookup_custom

modify()

Set the lookup_custom attribute to the custom field name with a suffix of two underscores immediately followed by a lowercase c character to look up and modify objects matching a custom field value.

Sample code: Update Using Custom Field as Foreign Key Lookup — C#

method

Modify

ModifyOnCondition

modify()

Set the method attribute to custom equal to to update a custom field value.

Note:

You should modify custom field values inline with standard object properties in the argument object instead of using the custom equal to method. See the description for the enable_custom attribute in this table.

SOAP sample codes: Modify Custom Field Values with custom equal to Method — C# and Modify Custom Field Values with custom equal to Method — Java

update_custom

modify()

upsert()

Set the update_custom attribute to 1 to set custom field values inline when modifying objects.

SOAP sample code: Update Custom Field Value as Object Property — C#