<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "tvOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntentsTesting",
  "identifier" : "/documentation/AppIntentsTesting/AnyAppIntent/subscript(dynamicMember:)-127ab",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "App Intents Testing"
    ],
    "preciseIdentifier" : "s:17AppIntentsTesting03AnyA6IntentV13dynamicMemberxSS_tc0aB11TypeSupport0E16ValueConvertibleRzluip"
  },
  "title" : "subscript(dynamicMember:)"
}
-->

# subscript(dynamicMember:)

Accesses an intent parameter by name, for comparison with a known value.

```
subscript<T>(dynamicMember identifier: String) -> T where T : IntentValueConvertible { get throws }
```

## Overview

The code below shows the syntactic sugar
and the equivalent, desugared, subscript syntax.

```swift
try intent.someName == "My Name"
try intent[dynamicMember: "someName"] == "My Name"
```

If the property’s value isn’t an instance of the type `T`,
this subscript throws an error.

For more information about dynamic-member syntax,
see [dynamicMemberLookup](https://docs.swift.org/swift-book/documentation/the-swift-programming-language/attributes#dynamicMemberLookup) in *[The Swift Programming Language](https://docs.swift.org/swift-book/)*.

---

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)