---
title: "init(exporting:importing:)"
framework: appintents
role: symbol
role_heading: Initializer
path: "appintents/intentvaluerepresentation/init(exporting:importing:)-550j7"
---

# init(exporting:importing:)

an entity and an IntentPerson.

## Declaration

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

## Parameters

- `exporting`: A closure that converts an entity to an IntentPerson.
- `importing`: A closure that converts an IntentPerson back to an entity.

## Example

Example struct ContactEntity: AppEntity, Transferable {     static var transferRepresentation: some TransferRepresentation {         ValueRepresentation(             exporting: { contact in                 IntentPerson(                     identifier: .applicationDefined(contact.id),                     name: .displayName(contact.name),                     handle: .init(emailAddress: contact.email)                 )             },             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 ?? ""                 )             }         )     } }
