---
title: "subscript(sectionName:)"
framework: swiftdata
role: symbol
role_heading: Instance Subscript
path: "swiftdata/resultssectioncollection/subscript(sectionname:)"
---

# subscript(sectionName:)

Returns the section with the given name, or nil if no such section exists.

## Declaration

```swift
subscript(sectionName name: SectionName) -> ResultsSection<Element, SectionName>? { get }
```

## Overview

Overview note: O(1)

## See Also

### Retrieving sections

- [ResultsSection](swiftdata/resultssection.md)
