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

# subscript(_:)

Accesses a nested property on a collection element by index.

```
subscript(index: Int) -> DynamicPropertyPath { get }
```

## Overview

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

```swift
let result = try await intent.run() // Expected an array of customer entities

result.value[0].name == nil
CreateCoffeeIntent.makeIntent(customerName: result.value[0].name)
```

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)