---
title: "ComputedProperty(indexingKey:)"
framework: appintents
role: symbol
role_heading: Macro
path: "appintents/computedproperty(indexingkey:)"
---

# ComputedProperty(indexingKey:)

A macro that adds a computed app entity property with get and set accessors.

## Declaration

```swift
@attached(peer, names: prefixed(`$`), prefixed(`_`)) @attached(accessor, names: named(get), named(set)) macro ComputedProperty(indexingKey: PartialKeyPath<CSSearchableItemAttributeSet>)
```

## Parameters

- `indexingKey`: A Spotlight attribute set key mapping for this property.

## Overview

Overview A deferred property has a few trade-offs: The system doesn’t index it when you donate an IndexedEntity to a Spotlight index. The system doesn’t send it to Shortcuts or Siri automatically; it fetches the value only when needed. Example struct Restaurant: AppEntity {     var model: Menu

@ComputedProperty(indexingKey: \.displayName)     var menuItems: [MenuItem] {         model.menuItems     } }

## See Also

### Property declarations

- [ComputedProperty()](appintents/computedproperty().md)
- [ComputedProperty(title:)](appintents/computedproperty(title:).md)
- [ComputedProperty(customIndexingKey:)](appintents/computedproperty(customindexingkey:).md)
- [ComputedProperty(title:customIndexingKey:)](appintents/computedproperty(title:customindexingkey:).md)
- [ComputedProperty(title:indexingKey:)](appintents/computedproperty(title:indexingkey:).md)
- [DeferredProperty()](appintents/deferredproperty().md)
- [DeferredProperty(title:)](appintents/deferredproperty(title:).md)
- [DeferredProperty(indexingKey:)](appintents/deferredproperty(indexingkey:).md)
- [DeferredProperty(title:indexingKey:)](appintents/deferredproperty(title:indexingkey:).md)
- [EntityProperty](appintents/entityproperty.md)
- [EntityPropertyModifiers](appintents/entitypropertymodifiers.md)
- [Property comparators](appintents/property-comparators.md)
