Creative Template Field Validation FAQ

Creative Templates are the way to define native ad units in Kevel. These templates contain a set of user-defined fields that assist with enforcing consistency between what your teams have the option to enter and the code your application expects to encounter in an ad decision request. Custom validation on template fields allows users to specify a set of allowed values or a regex pattern that the system will validate input against. Allowed value options are rendered as a dropdown in the UI when creating ads to streamline AdOps workflow by only showing the options that match the desired business rules for that type of creative. Templates can be configured with these options via the UI in the Studio tab or via the API.

FAQ

Regex — what’s that?

You can match almost any text pattern using a regular expression. That’s why we use this format: to provide maximum flexibility and accommodate any business rules.

What are some example use cases for adding a regex to a Creative Template field?

Why would I set “allowed values” on a field?

What happens to my existing Creative Templates?

What are all the options for controlling creative template field input values?

Are there any restrictions when editing Creative Templates that have validation rules?

What does a Creative Template schema look like in the API with validation rules?

{
    "Id": 1234,
    "Name": "Validation Example",
    "Description": "Created using Kevel Studio",
    "IsArchived": false,
    "Fields": [
        {
            "Type": "String",
            "AllowedValues": [
                "apple",
                "pear",
                "orange",
                "peach",
                "plum"
            ],
            "Description": "Select one of the following",
            "Required": false,
            "Variable": "ctFruit",
            "Name": "Fruit",
            "AdQuery": false
        },
        {
            "Type": "String",
            "Description": "Enter a valid URL",
            "Regex": "/^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$/",
            "Required": false,
            "Variable": "ctUrl",
            "Name": "URL",
            "AdQuery": false
        }
    ],
    "Contents": []
}

How do fields show up in the UI?

How are fields configured in Studio?

Look for the Allowed Values and Regex fields in the Field properties panel on the right side of the page as shown in the screenshot below.

Updated10 months ago