For custom properties types and validations in Mobile Developer Actions, the following custom action JSONs should have label and type populated: inputRequired=true, string, boolean, number, object, and datetime.

Note: JSON is not valid with either value left blank.

Examples:

Valid Custom Action JSON start

{ ‘label’: “My Custom action’, ‘type’: ‘myCustomType’, …….. (other custom action attributes here) }

Invalid Custom Action JSON start:

{ ‘label’: “”, ‘type’: ”, …….. (other custom action attributes here) }

An error message is displayed if an invalid Custom Action JSON start is used.

Example of an Android Error Message

Each custom property element should have id and type attributes populated. If the inputRequired attribute is set to true, a placeholder attribute value is required. The placeholder value should be non-blank – not null, not an empty string (“”), and not a blank string (” ” – string with one or more spaces, but no actual text).

Custom property element of type “boolean”

Valid values for boolean custom property elements are true or false without quotes. Empty strings indicate that there is no preselected value.

Valid JSON with no value

{
‘id’: ‘likesPizza’,
‘inputRequired’: true,
‘type’: ‘boolean’,
‘placeholder’: ‘Do you like pizza?’,
‘value’: “” //empty value – marketer would be forced to provide an input
}

Valid JSON with pre-selected value = false (please note – no quotes)

{
‘id’: ‘likesPizza’,
‘inputRequired’: true,
‘type’: ‘boolean’,
‘placeholder’: ‘Do you like pizza?’,
‘value’: false //SX UI will show pre-selected choice corresponding to false
}

Example of how it would be send to Xtify (Assuming type of the custom action is myCustomType and label is My Custom action):

{“type”: “myCustomType”, “name”: “My Custom action”, “likesPizza”: false}

Invalid JSON (boolean value in quotes)

{
‘id’: ‘likesPizza’,
‘inputRequired’: true,
‘type’: ‘boolean’,
‘placeholder’: ‘Do you like pizza?’,
‘value’: “yes”
}

Custom property element of type “datetime”

The datetime custom property element value property date, or timestamp in ISO-18601 format.

Note:

  • Validation for this datatype is a stretch goal
  • Allowing marketer to update the value in the SX UI is also a stretch goal. If we can show it in SX UI, then we could possibly allow empty string as value as well.

Valid JSON with date only value (yyyy-mm-dd format)

{
‘id’: ‘eventDay’,
‘inputRequired’: false,
‘type’: ‘datetime’,
‘placeholder’: ”,
‘value’: “2015-09-15”
}

Example of how it would be sent to Xtify (assuming type of the custom action is myCustomType and label is My Custom action) – we would add the time and timezone component (I am not sure what time zone we will add here – possibly server time zone):

{“type”: “myCustomType”, “name”: “My Custom action”, “eventDay”: “2015-09 15T00:00:00+05:00”}

Valid JSON with date and time, but without timezone (yyyy-mm-ddThh:mm:ss.ffffff format)

{
‘id’: ‘event’,
‘inputRequired’: false,
‘type’: ‘datetime’,
‘placeholder’: ”,
‘value’: “2015-09-15T15:53:00”
}

Example of how it would be sent to Xtify (assuming type of the custom action is myCustomType and label is My Custom action) – we would add the timezone component (I am not sure what time zone we will add here – possibly server time zone):

{“type”: “myCustomType”, “name”: “My Custom action”, “event”: “2015-09-15T15:53:00+05:00”}

Valid JSON with date, time, and timezone (yyyy-mm-ddThh:mm:ss.nnnnnn+|-hh:mm format)

{ ‘id’: ‘myEvent’, ‘inputRequired’: false, ‘type’: ‘datetime’, ‘placeholder’: ”, ‘value’: “2015-09-15T15:53:00-02:00” }

Example of how it would be send to Xtify (assuming type of the custom action is myCustomType and label is My Custom action):

{“type”: “myCustomType”, “name”: “My Custom action”, “myEvent”: “2015-09-15T15:53:00-02:00”}

Invalid JSON

{
‘id’: ‘postXMasSale’,
‘inputRequired’: false,
‘type’: ‘datetime’,
‘placeholder’: ”,
‘value’: “12/26/2015”
}

Custom property element of type “number”

The number custom property element value must equal a number not enclosed in quotes i.e. 4523, or 45.3, but not ‘23123’ or ‘23123’. However, empty string should indicate no value.

Valid JSON with no value

{
“id”: “productID”,
“inputRequired”: true,
“type”: “number”,
“placeholder”: “Enter valid product id”,
“value”: “” //empty value – marketer would be forced to provide an input
}

Valid JSON with provided value

{
‘id’: ‘productID’,
‘inputRequired’: true,
‘type’: ‘number’,
‘placeholder’: ‘Enter valid product id’,
‘value’: 123456
}

Example of how it would be send to Xtify (Assuming type of the custom action is myCustomType and label is My Custom action)

{“type”: “myCustomType”, “name”: “My Custom action”, “productID”: 123456}

Invalid JSON with provided value

{
‘id’: ‘productID’,
‘inputRequired’: true,
‘type’: ‘number’,
‘placeholder’: ‘Enter valid product id’,
‘value’: “123456”
}

Custom property element of type “object”

The object custom value property should be a valid JSON. Currently we can’t display it in the Send Experience (SX) UI, so the inputRequired value should be false, but we do not validate on this in UI.

Valid JSON with value

{
‘id’: ‘recipients’,
‘inputRequired’: false,
‘type’: ‘object’,
‘placeholder’: ”,
‘value’: [“email1@test.com”, “email2@test.com”] }

Example of how it would be sent to Xtify (assuming type of the custom action is myCustomType and label is My Custom action)

{“type”: “myCustomType”, “name”: “My Custom action”, “recipients”: [“email1@test.com”, “email2@test.com”] }

Valid JSON with value

{
‘id’: ‘recipientList’,
‘inputRequired’: false,
‘type’: ‘object’,
‘placeholder’: ”,
‘value’: {
’emails’: [
{
‘address’: ‘test1@email.com’
},
{
‘address’: ‘test2@email.com’
}
] }
}

Example of how it would be sent to Xtify (assuming type of the custom action is myCustomType and label is My Custom action)

{“type”: “myCustomType”, “name”: “My Custom action”,
“recipientList”: {
’emails’: [
{
‘address’: ‘test1@email.com’
},
{
‘address’: ‘test2@email.com’
}
] }
}

Custom property element of type “string”

The string custom property element has no validation in UI, except parsing of the JSON (if the developer forgot one quote, for example).

Example

A placeholder value is needed if input is required so it displays in the Send Experience UI above the text box.

{
‘id’: ‘product’,
‘inputRequired’: true,
‘type’: ‘string’,
‘placeholder’: ‘Enter the product ID’,
‘value’: ‘SKU123’ //value could be left blank if input is required
}

This is represented in the Send Experience UI as a text box (if inputRequired = true).

Example of how it would be sent to Xtify (Assuming type of the custom action is myCustomType and label is My Custom action)

{“type”: “myCustomType”, “name”: “My Custom action”, “product”: “SKU123”}

Custom property element with inputRequired = true

The inputRequired = true placeholder attribute should not be empty.

Valid JSON with populated non-blank placeholder

{
‘id’: ‘product’,
‘inputRequired’: true,
‘type’: ‘string’,
‘placeholder’: ‘Enter the product ID’,
‘value’: ”
}

Invalid JSON with null placeholder

{
‘id’: ‘product’,
‘inputRequired’: true,
‘type’: ‘string’,
‘placeholder’: null,
‘value’: ”
}

Invalid JSON with empty placeholder

{
‘id’: ‘product’,
‘inputRequired’: true,
‘type’: ‘string’,
‘placeholder’: “”,
‘value’: ”
}

Invalid JSON with blank placeholder

{
‘id’: ‘product’,
‘inputRequired’: true,
‘type’: ‘string’,
‘placeholder’: ” “,
‘value’: ”
}

Join The Discussion

Your email address will not be published. Required fields are marked *