<!--
{
  "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/AnyAppEntity/subscript(dynamicMember:)-4bdp1",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Subscript",
  "symbol" : {
    "kind" : "Instance Subscript",
    "modules" : [
      "App Intents Testing"
    ],
    "preciseIdentifier" : "s:17AppIntentsTesting03AnyA6EntityV13dynamicMember0aB11TypeSupport21IntentValueExpressing_pSgSS_tcip"
  },
  "title" : "subscript(dynamicMember:)"
}
-->

# subscript(dynamicMember:)

Accesses an entity property by name, without casting.

```
subscript(dynamicMember identifier: String) -> (any IntentValueExpressing)? { get }
```

## Overview

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

```swift
entity.someName == nil
entity[dynamicMember: "someName"] == nil

CreateCoffeeIntent.makeIntent(customerName: entity.someName)
CreateCoffeeIntent.makeIntent(customerName: entity[dynamicMember: "someName"])
```

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)