<!--
{
  "availability" : [
    "Xcode: 27.0.0 -",
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Evaluations",
  "identifier" : "/documentation/Evaluations/EvaluationResult/saveJSON(to:includeReportMetadata:includeTranscripts:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Evaluations"
    ],
    "preciseIdentifier" : "s:11Evaluations16EvaluationResultV8saveJSON2to21includeReportMetadata0G11Transcripts10Foundation3URLVAJ_S2btKF"
  },
  "title" : "saveJSON(to:includeReportMetadata:includeTranscripts:)"
}
-->

# saveJSON(to:includeReportMetadata:includeTranscripts:)

Saves evaluation results to a single JSON file.

```
@discardableResult func saveJSON(to directory: URL, includeReportMetadata: Bool = false, includeTranscripts: Bool = false) throws -> URL
```

## Parameters

`directory`

The directory to save the file in.

`includeReportMetadata`

Whether to include report metadata. Defaults to `false`.

`includeTranscripts`

Whether to encode each row’s transcript into the `Transcript`
column as JSON. Defaults to `false`. Enable when you want a saved file that carries
transcripts.

## Return Value

The URL of the saved file

## Discussion

The file contains sections for summary, results, metadata, and optionally report metadata.

---

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)