Learn more about our native MCP
Directus Logo
  • Use Cases and Features
    • Headless CMS
      Manage and deliver content with ease
    • Backend-as-a-Service
      Build and ship applications faster
    • Headless Commerce
      A single source of truth for products
    • 100+ More Use Cases
      Build anything (or everything)
    • Instant APIs
      Connect a database, get REST + GraphQL APIs
    • Granular Policy-Based Auth
      Provide secure, autonomous data access
    • Visual Automation Builder
      Automate content and data workflows with ease
    • 50+ More Features
      Get everything you need out-of-the-box
    Project Showcase
    Built With Directus

    Built With Directus

    See what everyone's been building with Directus

  • Learn More
    • Blog
      Read our latest articles and guides
    • Case Studies
      Case studies and success stories
    • Community Forum
      Questions and conversations
    • Agency Directory
      Browse our list of agency partners
    • About Us
      Learn more about Directus and the team
    • Wall of Love
      See what others are saying about us
    • Contact
      Have a general inquiry or question for us?
    • Support
      Reach out to Directus support
    Watch Directus TV
    Directus TV
    Video

    Directus TV

    Go down the rabbit hole with hours of original video content from our team.

  • Developers
  • Enterprise
  • Pricing
Book a DemoGet StartedLog In
GitHub logo34,629
Directus Marketplace
Marketplace
  1. Extensions
  2. Integrations
  3. Templates
Back to Extensions
interface

Multilevel Autocomplete API Interface

Get data from nested API queries.

Multilevel Autocomplete Interface

Get data from nested API queries.

An open dialog with multiple dropdowns

Installation

Refer to the Official Guide for details on installing the extension from the Marketplace or manually.

Usage

Add the Multilevel Autocomplete via the interface selector. Select either a Web Request or a List and fill in the corresponding fields that define how to load the initial step. Add items to the Nested Steps list to define additional steps. Lastly, define your Payload template to produce the final output.

Example

In this example, a fixed list of regions will be shown, and then a filtered list of countries will be shown as an autocomplete interface powered by an external API.

1. Initial List

When using a list as the initial source, you must provide a fixed set of values, each with a text and a value. The value can be a string of JSON object.

Create two items in the list (you can paste in the following as a raw value):

[
    {
        "text": "Europe",
        "value": "europe"
    },
    {
        "text": "Americas",
        "value": "americas"
    }
]

The value chosen will be stored as the first item in the values array that can be referenced in nested steps.

2. Filtered Autocomplete

Create a nested step which will use the selected region. Make a GET request to https://restcountries.com/v3.1/region/{{values[0]}}.

  • As this API returns the array of options directly, there is no need to provide a Requests Path.
  • Set the Text Path to name.common to use this value as the visible text for options.
  • Set the Value Path to cca2 as this the raw value to be used.

3. Structured Payload

Finally, set a payload that will be included in the raw data:

{
    "region": "{{ values[0] }}",
    "country": {
        "name": "{{ steps[1].text }}",
        "code": "{{ steps[1].value }}"
    }
}

4. Outcome

In use, the interface will first show a dropdown with two options - Europe and Americas. Using the external API, the nested step will show an autocomplete interface of countries filtered by the value chosen.

The raw data includes text and value for all steps, and the defined payload structure:

{
    "steps": [{
        "text": "Europe",
        "value": "europe"
    }, {
        "text": "United Kingdom",
        "value": "GB"
    }],
    "payload": {
        "region": "europe",
        "country": {
            "name": "United Kingdom",
            "code": "GB"
        }
    }
}

Calling the Items API

You can use this extension with the REST API generated for your Directus Project.

This allows for filtered inputs based on your own project's data using the filter and search parameters.

When configuring the request, you must include your full Directus project URL.

@directus-labs/multilevel-autocomplete-api-interface

npm i @directus-labs/multilevel-autocomplete-api-interface
This extension is sandboxed and can be installed through the Directus Marketplace.
Kevin Lewis
Kevin Lewis
Verified
1.0.0
Works with v10.10.0+
Updated 1 year ago
MIT License
287.8 KiB (3 files)
npm
  • Directus LogoDirectus Logo

    A composable backend to build your Headless CMS, BaaS, and more. 

  • Solutions
    • Headless CMS
    • Backend-as-a-Service
    • Product Information
    • 100+ Things to Build
  • Resources
    • Documentation
    • Guides
    • Community
    • Release Notes
  • Support
    • Issue Tracker
    • Feature Requests
    • Community Chat
    • Cloud Dashboard
  • Organization
    • About
    • Careers
    • Brand Assets
    • Contact
©2026 Monospace Inc
  • Cloud Policies
  • License
  • Terms
  • Privacy