<!--
{
  "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/DynamicPropertyPath",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "App Intents Testing"
    ],
    "preciseIdentifier" : "s:17AppIntentsTesting19DynamicPropertyPathV"
  },
  "title" : "DynamicPropertyPath"
}
-->

# DynamicPropertyPath

A type-safe, dynamic path to access nested intent values.

```
@dynamicMemberLookup struct DynamicPropertyPath
```

## Overview

You typically don’t create instances of `DynamicPropertyPath` directly. The system
returns instances of the type to indicate that you can further traverse a nested property.
Use `DynamicPropertyPath` for chained property access and array indexing on entities and intent results.

```swift
// Navigate nested properties.
let name: String = try entity.profile.name

// Index properties into an array.
let first: String = try entity.tags[0]

// Cast the entity to a known entity type definition.
let coffee: AnyAppEntity = try result.value.as(CoffeeEntity)
```

## Topics

### Instance Methods

[`func `as`<T>(T.Type) throws -> T`](/documentation/AppIntentsTesting/DynamicPropertyPath/as(_:)-5po1a)

Casts a property to the provided type.

[`func `as`<IntentType>(IntentType) throws -> IntentType.Instance`](/documentation/AppIntentsTesting/DynamicPropertyPath/as(_:)-6n9rh)

Casts the value to the given type.

[`func get<T>(as: T.Type) async throws -> T`](/documentation/AppIntentsTesting/DynamicPropertyPath/get(as:))

Resolves the value at this path, fetching it from the app if it was deferred.

### Subscripts

[`subscript(Int) -> (any IntentValueExpressing)?`](/documentation/AppIntentsTesting/DynamicPropertyPath/subscript(_:)-1hj9z)

Accesses a collection element by index, without casting.

[`subscript(Int) -> DynamicPropertyPath`](/documentation/AppIntentsTesting/DynamicPropertyPath/subscript(_:)-4bof1)

Accesses a nested property on a collection element by index.

[`subscript<T>(Int) -> T`](/documentation/AppIntentsTesting/DynamicPropertyPath/subscript(_:)-kiay)

Accesses a collection element by index, for comparison with a known value.

[`subscript(dynamicMember _: String) -> DynamicPropertyPath`](/documentation/AppIntentsTesting/DynamicPropertyPath/subscript(dynamicMember:)-aj9z)

Creates a dynamic path for navigating deeper into a nested property hierarchy.

[`subscript(dynamicMember _: String) -> (any IntentValueExpressing)?`](/documentation/AppIntentsTesting/DynamicPropertyPath/subscript(dynamicMember:)-hqdv)

Accesses a property by name without casting.

[`subscript<T>(dynamicMember _: String) -> T`](/documentation/AppIntentsTesting/DynamicPropertyPath/subscript(dynamicMember:)-lizi)

Accesses a typed property at the current path by name.

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

---

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)