Redgren Grumbholdt
Redgren Grumbholdt

Reputation: 1230

Which field can I use to capture a string in Twilio Autopilot. Twilio.ALPHANUMERIC does not work

I want to collect a portion of the message as a string that can contain a combination of letters(upper/lower), numbers, dashes, spaces, slashes and I cannot define all the possible values in a Custom Field because they are dynamic. This string can be:

1. AFCON 2020
2. England
3. FIFA WC 2016

etc.

I have tried using TWILIO.ALPHANUMERIC but it cuts out other parts or it returns first letter only. How can I solve this?

Upvotes: 0

Views: 202

Answers (1)

yvesonline
yvesonline

Reputation: 4837

I guess you already found the list of Twilio's built-in field types here. If none of the built-in's work for you you have two options:

A) Don't provide a type, if you don't provide a type then free-form input will be collected. See the documentation.

B) Use a custom field type. If you have only a selected number of options then this should be your choice.

For B) you could specify this as:

"fieldTypes": [
    {
        "uniqueName": "Custom.SELECTIONS",
        "values": [
            {
                "language": "en-US",
                "value" : "AFCON 2020",
                "synonymOf" : null
            },
            {
                "language": "en-US",
                "value" : "England",
                "synonymOf" : null
            },
            {
                "language": "en-US",
                "value" : "FIFA WC 2016",
                "synonymOf" : null
            },
            ...
        ]
    }
]

You would use this then as "type": "Custom.SELECTIONS"

Upvotes: 1

Related Questions