Editing data sources with advanced mode
If you want to make changes to a data source schema at the code level (JSON format), you can use Advanced Mode.
Warning: Making changes to a data source that is in use will impact communications using the data.
To edit a data source schema in Advanced Mode:
- Click Data to display the list of available data sources (use Add Data Source to add any new data sources).
- Click on the data source that you wish to edit.
- Click the Data Schema tab.
- Click the Advanced Mode button at the right.
A JSON listing of the data schema is now displayed and can be edited. An example is shown below:
{
"fields": [
{ "location": "first_name",
"name": "first_name",
"type": "string",
"isHidden": false,
"reporting": true
},
{ "location": "house_number",
"name": "house_number",
"type": "string",
"isHidden": false,
"reporting": false
},
{ "location": "street",
"name": "street",
"type": "string",
"isHidden": false,
"reporting": true
},
{ "location": "surname",
"name": "surname",
"type": "string",
"isHidden": false,
"reporting": true
}
]
}
Note: If you make an edit that results in incorrect JSON syntax, an error message will be displayed.
The table below describe each property that you can modify:
Property name | Description |
---|---|
name | The name of a column that will be used when inserting fields into communications. Changing this property value will automatically change the data field name in communications where this data source was already used. Note: This property is mandatory.
|
location | This identifies the position of the data in the data source file. Modifying this property may prevent loading of data, and the only valid reason for any changes is to swap the location value between two columns in order to load different data into them. Note: This property is mandatory.
|
type |
The type of data in this column. Allowed data types are as follows:
Note: This property is mandatory.
|
array_type | This defines the data type contained in a column of type array. |
parent | The parent object location. |
inputFormat | A property of the time, date and datetime data types that helps the system to identify the format of the data in the column (see the table below). |
customThousandSeparator | A property of the number data type. It allows you to customize the default locale thousand separator. |
customDecimalSeparator | A property of the number data type. It allows you to customize the default locale decimal separator. |
customDecimalPlaces | A property of the number data type. It allows you to customize the default locale number of decimal places. |
customTimeFormat | A property of the time and datetime data types. It allows you to customize the default locale time format (see the table below). For the datetime type, it defines the time part of the formatted output. |
customShortDateFormat | A property of the date and datetime data types. It allows you to customize the default short date format (see the table below). For the datetime type, it defines the date part of the formatted output using the short date option. This custom format should not contain time (that should be defined separately using customTimeFormat). |
customLongDateFormat | A property of the date and datetime data types. It allows you to customize the default long date format (see the table below). For the datetime type, it defines the date part of the formatted output using the long date option. This custom format should not contain time (that should be defined separately using customTimeFormat). |
isHidden | A boolean property that can be set to true or false and applied to any field. If set to true, the field is hidden in the UI. |
reporting | A boolean property that can be set to true or false and applied to any field. If set to true, the field is included in the Reporting CSV file. |
In the following cases, an error message is displayed:
- A key property (name, location or type) is missing.
- An additional property is included that is not allowed.
- A property has an incorrect value type.
The table below shows the format patterns for the time, date and datetime types.
Note: The inputs are case-sensitive.
Input | Example | Description |
---|---|---|
YYYY | 2014 | 4 or 2 digit year. Note: Only a 4 digit year can be parsed on strict mode. |
YY | 14 | 2 digit year. |
Y | -25 | Year with any number of digits and sign. |
Q | 1..4 | Quarter of year. Sets month to first month in quarter. |
M MM | 1..12 | Month number. |
MMM MMMM | Jan..December | Month name in locale. |
D DD | 1..31 | Day of month. |
Do | 1st..31st | Day of month with ordinal. |
DDD DDDD | 1..365 | Day of year. |
H HH | 0..23 | Hours (24 hour time). |
h hh | 1..12 | Hours (12 hour time used with "a" or "A"). |
k kk | 1..24 | Hours (24 hour time from 1 to 24). |
a A | am PM | Post or ante meridiem. Note: The single character "a" or "p" is also considered valid. |
m mm | 0..59 | Minutes. |
s ss | 0..59 | Seconds. |