---
title: "entities(matching:)"
framework: appintentstesting
role: symbol
role_heading: Instance Method
path: "appintentstesting/appentitydefinition/entities(matching:)"
---

# entities(matching:)

Finds app entities that match a given string query.

## Declaration

```swift
func entities(matching string: String) async throws -> [AnyAppEntity]
```

## Parameters

- `string`: The search string to match against entity properties.

## Mentioned in

Testing your App Intents code

## Return Value

Return Value An array of entities that match the search criteria.

## Discussion

Discussion note: Any errors encountered during the query execution.

## See Also

### Searching matching entities

- [entities(identifiers:)](appintentstesting/appentitydefinition/entities(identifiers:).md)
- [entityQuery(identifiers:)](appintentstesting/appentitydefinition/entityquery(identifiers:).md)
- [entityQuery(matching:)](appintentstesting/appentitydefinition/entityquery(matching:).md)
- [spotlightQuery(_:)](appintentstesting/appentitydefinition/spotlightquery(_:).md)
