---
title: AnyAppEntity
framework: appintentstesting
role: symbol
role_heading: Structure
path: appintentstesting/anyappentity
---

# AnyAppEntity

A type-erased, intermediate representation of your app entity for testing purposes.

## Declaration

```swift
@dynamicMemberLookup struct AnyAppEntity
```

## Mentioned in

Testing your App Intents code

## Overview

Overview The AnyAppEntity structure resolves to your actual entity type and gives you access to its properties, enabling you to test your app entity code: // Define your app entity type from your app bundle: let definitions = IntentDefinitions(     bundleIdentifier: "com.apple.example" ) let exampleEntity = definitions.entities[     "ExampleEntity" ]

// Create an entity from an identifier. let entity = exampleEntity.makeReference(     identifier: "my-example" )

// Type-safe access to the entity's properties. let name: String? = entity.name let itemCount: Int? = entity.itemCount

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

## Topics

### Identifying the entity

- [identifier](appintentstesting/anyappentity/identifier.md)

### Instance Methods

- [exported(as:)](appintentstesting/anyappentity/exported(as:)-54w7m.md)
- [exported(as:)](appintentstesting/anyappentity/exported(as:)-7pg2q.md)
- [exported(as:)](appintentstesting/anyappentity/exported(as:)-8qa8k.md)

### Subscripts

- [subscript(dynamicMember:)](appintentstesting/anyappentity/subscript(dynamicmember:)-4bdp1.md)
- [subscript(dynamicMember:)](appintentstesting/anyappentity/subscript(dynamicmember:)-5twll.md)
- [subscript(dynamicMember:)](appintentstesting/anyappentity/subscript(dynamicmember:)-yuv.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [IntentValueConvertible](appintents/intentvalueconvertible.md)
- [IntentValueExpressing](appintents/intentvalueexpressing.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Intermediate types

- [AnyAppIntent](appintentstesting/anyappintent.md)
- [AnyEntityQuery](appintentstesting/anyentityquery.md)
- [AnyAppEnum](appintentstesting/anyappenum.md)
- [AnyTransientAppEntity](appintentstesting/anytransientappentity.md)
