---
title: "element(at:)"
framework: swiftdata
role: symbol
role_heading: Instance Method
path: "swiftdata/resultsobserver/element(at:)"
---

# element(at:)

Returns the element at the given index path in the sectioned results.

## Declaration

```swift
final func element(at indexPath: IndexPath) -> Element?
```

## Parameters

- `indexPath`: An index path where indexPath[0] is the section index and indexPath[1] is the item index within that section.

## Return Value

Return Value The element at the given index path, or nil if sections is nil or the index path is out of bounds.

## See Also

### Accessing observer results

- [results](swiftdata/resultsobserver/results.md)
- [indexPath(for:)](swiftdata/resultsobserver/indexpath(for:).md)
