<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/DynamicOptionsProvider",
  "metadataVersion" : "0.1.0",
  "role" : "Protocol",
  "symbol" : {
    "kind" : "Protocol",
    "modules" : [
      "App Intents"
    ],
    "preciseIdentifier" : "s:10AppIntents22DynamicOptionsProviderP"
  },
  "title" : "DynamicOptionsProvider"
}
-->

# DynamicOptionsProvider

An interface for providing a dynamic list of options for a parameter of your app intent.

```
protocol DynamicOptionsProvider : _SupportsAppDependencies
```

## Overview

Implement this protocol in a type that provides a set of possible
values for an intent parameter. When configuring the parameter, specify
your custom type as the options provider for that parameter. The type
of result you return determines how the system displays the information.

- Return an array of [`DisplayRepresentable`](/documentation/AppIntents/DisplayRepresentable) types to display a list of values.
- Return an array of [`IntentItem`](/documentation/AppIntents/IntentItem) types to divide values
  into sections or configure other presentation options.

The following example shows the configuration of a custom parameter that
contains the author name of a book. The options provider offers two possible
suggestions for the author name. For brevity, it omits the rest of the
implementation.

```swift
struct CreateBook: AppIntent {
    @Parameter(title: "Author Name",
               optionsProvider: AuthorNamesOptionsProvider())
    var authorName: String

    // Other properties and the perform() implementation.

    private struct AuthorNamesOptionsProvider: DynamicOptionsProvider {
        func results() async throws -> [String] {
            ["Juan Chavez", "Anne Johnson"]
        }
    }
}
```

## Topics

### Returning the parameter options

[`results()`](/documentation/AppIntents/DynamicOptionsProvider/results())

[`defaultResult()`](/documentation/AppIntents/DynamicOptionsProvider/defaultResult())

The default value for parameters using this provider when no value is provided by the user.

[`Result`](/documentation/AppIntents/DynamicOptionsProvider/Result)

## Relationships

### Conforming Types

[`UniqueAppEntityProvider`](/documentation/AppIntents/UniqueAppEntityProvider)

### Inherited By

[`IndexedEntityQuery`](/documentation/AppIntents/IndexedEntityQuery)

[`EntityPropertyQuery`](/documentation/AppIntents/EntityPropertyQuery)

[`EntityStringQuery`](/documentation/AppIntents/EntityStringQuery)

[`UniqueAppEntityQuery`](/documentation/AppIntents/UniqueAppEntityQuery)

[`EnumerableEntityQuery`](/documentation/AppIntents/EnumerableEntityQuery)

[`EntityQuery`](/documentation/AppIntents/EntityQuery)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)