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

# init(exporting:importing:)

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

```
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

```swift
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
                )
            }
        )
    }
}
```

---

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)