---
title: "saveJSON(to:includeReportMetadata:includeTranscripts:)"
framework: Evaluations
role: symbol
role_heading: Instance Method
platforms: [iOS 27.0+, iPadOS 27.0+, Mac Catalyst 27.0+, macOS 27.0+, visionOS 27.0+, watchOS 27.0+, xcode 27.0+]
path: "evaluations/evaluationresult/savejson(to:includereportmetadata:includetranscripts:)"
---

# saveJSON(to:includeReportMetadata:includeTranscripts:)

Saves evaluation results to a single JSON file.

## Declaration

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

Return Value The URL of the saved file

## Discussion

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

## See Also

### Saving and loading results

- [jsonData(includeReportMetadata:includeTranscripts:jsonOptions:)](evaluations/evaluationresult/jsondata(includereportmetadata:includetranscripts:jsonoptions:).md)
- [loadJSON(from:)](evaluations/evaluationresult/loadjson(from:).md)
- [loadJSONLines(from:)](evaluations/evaluationresult/loadjsonlines(from:).md)
- [init(jsonData:)](evaluations/evaluationresult/init(jsondata:).md)
