Custom Variables

You can configure custom variables under custom extension policy. You can assign a value or a variable expression to a custom variable which can be used in other policy parameters. Custom variable also provides an option to set custom field to the transactional events. To set the custom fields, you have to define the customTransactionFields.FIELD_NAME custom variable with a custom key-value pair.

For example,

.

The field "key1" is configured as customKey and the field "value1" is configured as customValue.

The following snippet shows the general format of the customTransactionFields.FIELD_NAME custom variable.

{
	"customTransactionFields": [
		{
			"customKey": "key1",
			"customValue": "value1"
		},
		{
			"customKey": "key2",
			"customKey": "value2"
		}
	]
}
Note: For versions before 11.0, the custom variables are stored in the following format:
{
	"customFields" : {
		"key1" : "value1",
		"key2" : "value2"
	}
}
To search for a specific variable stored in custom transaction fields, use the AND condition type in the search query to find a particular key-value pair. To search for either the key or the value, use the OR condition type. For example,
{
    "types": ["TRANSACTION_EVENTS"],
    "scope": [
        {
            "attributeName": "customTransactionFields.customKey",
            "keyword": "key1"
        },
        {
            "attributeName": "customTransactionFields.customValue",
            "keyword": "value1"
        }
    ],
    "condition": "or",
    "responseFields": [
        "apiName",
        "apiVersion"
    ]
}

It also provides an option to configure namespaces for XPath expressions. To configure the namespaces you have to define Xpath Namespaces custom variable.