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

# AnyTransientAppEntity

A type-erased representation of a transient app entity that provides dynamic property access.

```
@dynamicMemberLookup struct AnyTransientAppEntity
```

## Overview

Use `AnyTransientAppEntity` to work with transient entities when you don’t know the specific entity type at compile time.

```swift
// Getting transient entity definitions.
let definitions = IntentDefinitions(bundleIdentifier: "com.apple.example")
let sessionEntity = definitions.transientEntities["UserSessionEntity"]

// Creating a transient entity with properties.
var entity = sessionEntity.withProperties(
    name: "John Doe",
    age: 30
)

// Accessing properties with type safety.
let userName: String? = try entity.name
let userAge: Int? = try entity.age

// Accessing nested properties (requires try).
if try entity.profile.name == "John Doe" {
    print("User found")
}
```

## Topics

### Identifying the entity type

[`var entityType: AttributedTypeIdentifier`](/documentation/AppIntentsTesting/AnyTransientAppEntity/entityType)

The type of transient app entity represented by this identifier.

### Instance Methods

[`func exported<T>(as: T.Type) async throws -> T`](/documentation/AppIntentsTesting/AnyTransientAppEntity/exported(as:)-2rmw6)

Exports this transient entity as a transferable intent value type.

[`func exported(as: UTType?) async throws -> IntentFile`](/documentation/AppIntentsTesting/AnyTransientAppEntity/exported(as:)-7mrbg)

Exports this transient entity’s content as an `IntentFile`.

[`func exported<T>(as: T.Type) async throws -> T`](/documentation/AppIntentsTesting/AnyTransientAppEntity/exported(as:)-8zhnu)

Exports this transient entity as a system intent value type.

### Subscripts

[`subscript(dynamicMember _: String) -> (any IntentValueExpressing)?`](/documentation/AppIntentsTesting/AnyTransientAppEntity/subscript(dynamicMember:)-5ygut)

Accesses an entity property by name, without casting.

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

Accesses a nested entity property by name.

[`subscript<T>(dynamicMember _: String) -> T`](/documentation/AppIntentsTesting/AnyTransientAppEntity/subscript(dynamicMember:)-8pfwv)

Accesses an entity property by name, for comparison with a known value.

## Relationships

### Conforms To

[`IntentValueExpressing`](/documentation/AppIntents/IntentValueExpressing)

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

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

[`IntentValueConvertible`](/documentation/AppIntents/IntentValueConvertible)

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

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

[`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)