---
title: "subscript(dynamicMember:)"
framework: appintentstesting
role: symbol
role_heading: Instance Subscript
path: "appintentstesting/resolvedintentresult/subscript(dynamicmember:)-kbqk"
---

# subscript(dynamicMember:)

Returns the intent’s output, converted to the inferred type.

## Declaration

```swift
subscript<T>(dynamicMember keyPath: KeyPath<ResolvedIntentResult.ValueKeyPath, Never>) -> T where T : IntentValueConvertible { get throws }
```

## Overview

Overview Access the return value using the value key path, for example: let result = try await intent.run()

// Compare the result with a concrete value. XCTAssertEqual(try result.value, "Hello World") 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 in The Swift Programming Language.
