Configuring dropdown field options from an external source

Please note that this feature is exclusively available with specific pricing plans.

Paperform's Dropdown fields allow you to use an external options list, ideal for situations requiring dynamic data. This is supported by configuring the field to import options from an external public API of your choice.

Configuring your external API source

To use an external option list on Paperform, the output supplied by your API must provide data in the correct format.

Requirements

The response provided by your external API:

  1. Must return the response in less than 1 second.
  2. Is limited to 1000 options.
  3. Should support filtering options with the query parameter: query

Data format

The values should match the following TypeScript definition:

type Option {
   string | {label: string, value: string|number}
}

type OptionsResponse {
 | Option[]
 | {
      options: Option[]
      hasMore: boolean
   }
}

The hasMore property

Use the hasMore property to notify Paperform that there are more options available. This will ensure that a search will be performed and sent to your API.

By explicitly setting the hasMore parameter to false, Paperform won’t request data from the endpoint for subsequent searches and will perform filters client side.

Allowing data to be queried

To ensure that users can filter the data in the dropdown, please implement the query query parameter on your API endpoint.

For example, https://mydomain.com/options?query=abc.

When returning a filtered list, please return the hasMore property in the response.

Examples

Here are some examples to help structure your own responses:

Example 1

[
   "Option 1",
   "Option 2",
   "Option 3",
]

Example 2

[
   {
      label: "Option 1",
      value: "option_1",
   },
   {
      label: "Option 1",
      value: "option_1",
   }
]

Example 3

[
   options: [
      {
         label: "Option 1",
         value: "option_1",
      },
      {
         label: "Option 1",
         value: "option_1",
      }
   ],
   hasMore: true,
]

Example 4

[
   options: [
      "Option 1",
      "Option 2",
      "Option 3",
   ],
   hasMore: true,
]

External Options Response JSON Schema

{
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "options": {
          "$ref": "#/$defs/options_array"
        },
        "hasMore": {
          "type": "boolean"
        }
      },
      "required": [
        "options"
      ]
    },
    {
      "$ref": "#/$defs/options_array"
    }
  ],
  "$defs": {
    "options_array": {
      "type": "array",
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/options_object"
          },
          {
            "$ref": "#/$defs/options_string"
          }
        ]
      }
    },
    "options_object": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string"
        },
        "value": {
          "type": [
            "string",
            "number",
            "integer"
          ]
        }
      },
      "required": [
        "label",
        "value"
      ]
    },
    "options_string": {
      "type": "string"
    }
  }
}

Configuring external option lists

External option lists can be added directly when configuring a standard Dropdown field.

An image showing the default configurations screen of a Dropdown field in the form editor with an external options list source assigned.

Like the existing dropdown field, you can:

  • Allow multiple options to be selected,
  • Add an “other” option, and
  • Select a default option from your initial list.

You can also manage external options lists on the Account Services page.

An imagine displaying an example of an External Options List in the Account Services page of a Paperform account.

Considerations

  • The data sent to the form will be truncated at 1000 options. If you would like to make more than this available, please supply the hasMore property in your response and make sure you support filtering via the query parameter on the request.

Gotchas

  • Retrieving data from Google Sheets documents (for example via an Apps Script or Macro) is not currently supported.
  • If you have forms that are using an external options list, you will need to remove it from your form before deleting it in Account Services.

Related Articles

Can a user filter dropdown options by typing?
To filter dropdown options, you can simply type after selecting the dropdown box to begin filtering.
Can I let submitters choose multiple answers for a multiple-choice or dropdown question?
Yes, simply toggle "Can choose more than one answer" in the question's configuration. This works for both multiple-choice and dropdown questions.
Can I let the user type in their own answer for a multiple-choice or dropdown question?
Yes, for both question types. Simply toggle "Include an 'Other' option to specify another answer" in the question's configuration.
Can I limit the number of options that can be chosen for a Dropdown question?
You can allow multiple answers to a Dropdown question, but you can't specify a minimum or maximum number (you can with Multiple Choice).
My dropdown question is cut off when embedded. How can I fix it?
Dropdown menus can be cut off when there isn't enough space at the bottom of the form. Increase this space using blank lines to fix the problem.
How do I add a dropdown field to my form?
On a blank line, type "/dropdown" and select "Dropdown" from the popup menu, or click "Add questions" and select "Dropdown" from the question dropdown.
Can I use answer piping to add answers to multiple-choice or dropdown questions?
Multiple Choice and Dropdown fields can only be pre-filled, they cannot set their options using Answer Piping.
How do I randomize the option order for a Multiple-Choice or Dropdown question?
Simply toggle "Randomize option order" on/off in the question configuration.