<!--
{
  "availability" : [
    "iOS: 27.2.0 -",
    "iPadOS: 27.2.0 -",
    "macCatalyst: -",
    "macOS: 27.2.0 -",
    "tvOS: 27.2.0 -",
    "visionOS: 27.2.0 -",
    "watchOS: 27.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppIntents",
  "identifier" : "/documentation/AppIntents/IntentValueRepresentation/init(importing:)-6jio8",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "App Intents",
      "AppIntents"
    ],
    "preciseIdentifier" : "s:10AppIntents25IntentValueRepresentationVA2A0C6PersonVRs_rlE9importingACyxAEGxAEYaYbKc_tcfc"
  },
  "title" : "init(importing:)"
}
-->

# init(importing:)

Creates a value representation that imports an `IntentPerson` into an entity.

```
init(importing: @escaping @Sendable (IntentValue) async throws -> Item)
```

## Parameters

`importing`

A closure that converts an IntentPerson to an entity.

## Discussion

Use this initializer when your entity can be created from an `IntentPerson`, but has no
meaningful representation to export back out. The entity’s metadata declares `IntentPerson`
as importable only, and the entity is never offered for export as a person.

## Example

```swift
struct ContactEntity: AppEntity, Transferable {
    static var transferRepresentation: some TransferRepresentation {
        ValueRepresentation(
            importing: { person in
                guard case let .applicationDefined(id) = person.identifier?.value else {
                    throw ImportError.missingIdentifier
                }
                return ContactEntity(
                    id: id,
                    name: person.name.displayString,
                    email: person.handle?.value ?? ""
                )
            }
        )
    }
}
```

---

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)