account.updateCustomField
    • 2 Minutes to read
    • Dark
      Light

    account.updateCustomField

    • Dark
      Light

    Article summary

    General Information

    Use this method to update an existing custom field. To create a new custom field, use account.addCustomField.

    Arguments

    Field

    Description

    Field Type

    Required

    Example

    id

    The ID number of the custom field to be edited. The ID number is returned in the response XML message from the account.addCustomField method call. Use the account.getCustomFields method to retrieve the full set of custom fields created for your account. You can also find the ID number of a specific custom field within the application by logging into the application and navigating to Administration > Account and Segment IDs and then scrolling down to the Custom Fields section.

    number

    Yes

    1055589

    name

    The name of the custom field to be updated.

    string

    No

    Sign Up Date

    type

    The data type of the new custom field to be added. The values for this field include either of the following:

    • date

    • string

    • number

    • zip_code

    string

    No

    date

    format

    This element is used to define how the field value will be displayed within the body of an email when used as a personalization tag. What appears in this element depends upon the <type>If <type> is defined as date, the value of this element must be defined as either of the following options:

    • MM/DD/YYYY

    • DD/MM/YYYY

    • FMMonth ddth, YYYY (example: December 31st, 2010)

    • FMMonth ddth

    • YYY-MM-DD

    If <type> is defined as string, the value of this element is set to "string".

    If <type> is defined as number, this element must contain two sub-elements where:

    Sub-element name

    Value

    decimals

    Any digit between 0 and 9

    separators

    Either of the following options:

    • 1234567.89

    • 1,234,567.89

    • 1 234 567,89

    • 1.234.567,89

    string

    No

    DD/MM/YYYY

    display_on_survey

    A boolean value that defines whether the new custom field should be displayed in the standard survey web page (or the custom survey web page) where applicable.

    boolean where:

    • 0 – do not display (default)

    • 1 – display

    No

    1

    friendly_tag

    Defines the "friendly tag" name which is typically referenced within the email body for personalization. To view a list of existing friendly tag names within the application, log in and navigate to Assets > Manage Custom Fields and then look in the "Friendly Tag" column of the screen.

    string

    No

    signupDate

    default_value

    Sets the default value of the new custom field that is displayed within the body of the email when the subscriber's contact record does not include a value for this custom field.

    string

    No

    2011-01-01

    Response

    Field

    Description

    Example

    responseCode

    A code indicating either the success or failure of the operation. (see Error Codes below)

    140

    responseText

    Human readable description of the response code

    this custom field has been updated

    id

    The ID number of the custom field being updated as provided by the input XML message.

    1055589

    name

    The name of the custom field as provided by the input XML message.

    Sign Up Date

    type

    The field type as provided by the input XML message.

    date

    format

    The format as provided by the input XML message

    DD/MM/YYYY

    display_on_survey

    A boolean value that defines whether the newly added custom field should be displayed in the standard survey web page (or the custom survey web page) where applicable, as provided by the input XML message.

    1

    friendly_tag

    The "friendly tag" name which is typically referenced within the email body for personalization as provided in the input XML message

    signupDate

    default_value

    The default value of the new custom field that is displayed within the body of the email when the subscriber's contact record does not include a value for this custom field.


    Response Codes

    Error Condition

    responseCode

    responseText

    The value for the <format> element is incorrect according to the specification.

    131

    action not taken, invalid format

    The name of the custom field already exists. Field names must be unique

    132

    action not taken, field name already exists

    Successful operation

    140

    this custom field has been updated

    Invalid custom field ID number. Either the ID number does not exist, or the value passed for the <id> is not a number

    141

    action not taken, invalid field id

    Example Post

    <methodCall>
    <methodname>account.updateCustomField</methodname>
    <id>1055589</id>
    <name>Sign Up Date</name>
    <type>date</type>
    <format>YYYY-MM-DD</format>
    </methodCall>

    Example Response

    <methodName><![CDATA[account.updateCustomField]]></methodName>
    <responseCode><![CDATA[140]]></responseCode>
    <responseText><![CDATA[This custom field has been updated]]></responseText>
    <responseData>
    <id><![CDATA[1055589]]></id>
    <name><![CDATA[Sign Up Date]]></name>
    <type><![CDATA[string]]></type>
    <format><![CDATA[YYYY-MM-DD]]><format>
    </responseData>
    <responseNum><![CDATA[1]]></responseNum>

    Example Error

    <methodName><![CDATA[account.updateCustomField]]></methodName>
    <responseCode><![CDATA[141]]></responseCode>
    <responseText><![CDATA[action not taken, invalid field id]]></responseText>
    <responseData>
    <id><![CDATA[1055589]]></id>
    <name><![CDATA[Sign Up Date]]></name>
    <type><![CDATA[date]]></type>
    <format><![CDATA[YYYY-MM-DD]]></format>
    </responseData>
    <responseNum><![CDATA[1]]></responseNum>


    Was this article helpful?