account.addRelationalTable

‹ BACK TO API PAGE


Description

This method enables you to create a new relational table whose data will be used to create dynamic content. You may create a maximum of 4 relational tables.

Arguments

Field Description Field Type Required Example
table_name The programatic name of the table to be used when updating the table data. Limited to alphanumeric and underscores [A-Za-z0-9_] String Yes concert_info
display_name The name of the table that the marketer will see when viewing it within the application. String Yes Concert Info
columns An array containing the set of column arrays Array Yes See example below
column An array of data that will create the columns of data to be used in the relational table Array Yes See example below
column_name The programatic name of the column that will be used for two purposes
  1. The column header for the CSV import file when updating table data
  2. The personalization tag/token used within the iterative portion of the personalization template.

Limited to AlphaNumeric and underscores [A-Za-z0-9_]

String Yes concertDate
display_name The name users will see for the column when viewed within the application String Yes Concert Date
type The Relational Table is limited to 20 columns. It will allow for any combination of the four following data types:
  1. string (maximum of 10 string columns)
  2. date (maximum of 4 date columns)
  3. number (maximum of 5 numeric columns)
  4. geo (maximum of 1 geo/zip column)
String Yes date
format Determines the display format when the date or number field is populated within an emailDate
  • MM/DD/YYYY
  • DD/MM/YYYY
  • FMMonth ddth, YYYY
  • FMMonth ddth
  • YYYY-MM-DD

NOTE: Regardless of what display format you choose for the date field, the actual date value included in the uploaded data file must be formatted as YYYY-MM-DD

Number

  • 1234567
  • 1,234,567
  • 1234567.89
  • 1,234,567.89
String Conditional;Required if column.type is date or number FMMonth ddth

Response

Field Description Example
table_id Your assigned database ID used to identify this table 132
table_name The programmatic name of the table to be used when updating the table data. Limited to alphanumeric and underscores [A-Za-z0-9_] concert_info
display_name The name users will see for the table when viewed within the application Concert Info
columns This element acts as a wrapper of all individual columns within the relational table. See example below
item This element contains a single <column> element See example below
column This element identifies an individual column within the relational table. It acts as a wrapper for each individual column's metadata. See example below
column_name The programatic name of the column that will be used for two purposes
  1. The column header for the CSV import file when updating table data
  2. The personalization tag/token used within the iterative portion of the personalization template.
    Limited to alphanumeric and underscores [A-Za-z0-9_]
concertDate
display_name The name users will see for the column when viewed within the application Concert Date
type The relational table is limited to 20 columns. It will allow for any combination of the four following data types:
  1. string (maximum of 10 string columns)
  2. date (maximum of 4 date columns)
  3. number (maximum of 5 numeric columns)
  4. geo/zip (maximum of 1 geo/zip column)
date
format Determines the display format when the date or number field is populated within an emailDate
  • MM/DD/YYYY
  • DD/MM/YYYY
  • FMMonth ddth, YYYY
  • FMMonth ddth
  • YYYY-MM-DD

Number

  • 1234567
  • 1,234,567
  • 1234567.89
  • 1,234,567.89
FMMonth ddth

Response Codes

Error Condition responseCode responseText
Successful Relational Table Creation 601 This relational table has been added
Too many of any particular column type were passed:
  • more than 10 string columns
  • more than 5 Number columns
  • more than 4 Date columns
  • more than 1 geo/zip column
602 Action not taken, column limit exceeded
A "column_name" value passed contained an invalid character outside of [0-9A-Za-z_] 603 Action not taken, invalid column_name
The "table_name" value passed contained an invalid character outside of [0-9A-Za-z_] 604 Action not taken, invalid table_name
The "format" value wasn't passed along with a column "type" of "date", or the format isn't in the approved set of formats 605 Action not taken, format required for date column types / format is not valid
The "format" value wasn't passed along with a column "type" of "number", or the format isn't in the approved set of formats 606 Action not taken, format required for number column types / format is not valid
An incorrect value is passed for column "type" 608 Action not taken, invalid column type
A table already exists with the passed "table_name" or "display_name" 609 Action not taken, table_name or display_name already exist
The account already has the maximum number of relational tables allowed 612 Action not taken, table limit exceeded
Unknown exception error occurred 613 Action not taken, Exception while creating relational table

Example Post

<methodCall>

<methodName>account.addRelationalTable </methodName>

<table_name>contacts</table_name>

<display_name>Full Contacts Info</display_name>

<columns>

<column>

<column_name>F_name</column_name>

<display_name>First Name</display_name>

<type>string</type>

</column>

<column>

<column_name>l_name</column_name>

<display_name>Last Name</display_name>

<type>string</type>

</column>

<column>

<column_name>zip</column_name>

<display_name>Zip Code</display_name>

<type>geo</type>

</column>

<column>

<column_name>sal</column_name>

<display_name>Salary</display_name>

<type>number</type>

<format>1234567</format>

</column>

<column>

<column_name>dob</column_name>

<display_name>date of birth</display_name>

<type>date</type>

<format>MM/DD/YYYY</format>

</column>

</columns>

</methodCall>

Example Response

<methodResponse>

<item>

<methodName><![CDATA[account.addRelationalTable]]></methodName>

<responseCode><![CDATA[601]]></responseCode>

<responseText><![CDATA[This relational table has been added]]></responseText>

<responseData>

<item>

<table_id><![CDATA[4]]></table_id>

<table_name><![CDATA[contacts]]></table_name>

<display_name><![CDATA[Contacts Data]]></display_name>

<columns>

<item>

<column>

<column_name><![CDATA[dob]]></column_name>

<display_name><![CDATA[date of birth]]></display_name>

<format><![CDATA[MM/DD/YYYY]]></format>

<type><![CDATA[date]]></type>

</column>

</item>

<item>

<column>

<column_name><![CDATA[sal]]></column_name>

<display_name><![CDATA[Salary]]></display_name>

<format><![CDATA[1234567]]></format>

<type><![CDATA[number]]></type>

</column>

</item>

<item>

<column>

<column_name><![CDATA[F_name]]></column_name>

<display_name><![CDATA[First Name]]></display_name>

<type><![CDATA[string]]></type>

</column>

</item>

<item>

<column>

<column_name><![CDATA[l_name]]></column_name>

<display_name><![CDATA[Last Name]]></display_name>

<type><![CDATA[string]]></type>

</column>

</item>

<item>

<column>

<column_name><![CDATA[zip]]></column_name>

<display_name><![CDATA[Zip Code]]></display_name>

<type><![CDATA[geo]]></type>

</column>

</item>

</columns>

</item>

</responseData>

<responseNum><![CDATA[1]]></responseNum>

</item>

</methodResponse>

Example Error

<methodResponse>

<item>

<methodName><![CDATA[account.addRelationalTable]]></methodName>

<responseCode><![CDATA[608]]></responseCode>

<responseText><![CDATA[Action not taken, invalid column type]]></responseText>

<responseData></responseData>

<responseNum><![CDATA[1]]></responseNum>

</item>

</methodResponse>


Back to API Reference Guide