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

# init(exporting:importing:)

Creates a value representation that supports bidirectional conversion between an entity and a system intent value.

## 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 a system intent value.
- `importing`: A closure that converts a system intent value back to an entity.

## Example

Example struct LocationEntity: AppEntity, Transferable {     static var transferRepresentation: some TransferRepresentation {         IntentValueRepresentation(             exporting: { entity in                 PlaceDescriptor(                     representations: [                         .coordinate(.init(                             latitude: entity.latitude,                             longitude: entity.longitude                         ))                     ],                     commonName: entity.name                 )             },             importing: { place in                 guard let coordinate = place.coordinate else {                     throw ImportError.missingCoordinate                 }                 return LocationEntity(                     name: place.commonName ?? "Unknown Location",                     latitude: coordinate.latitude,                     longitude: coordinate.longitude                 )             }         )     } }
