---
title: Publishers.TryFirstWhere
framework: combine
role: symbol
role_heading: Structure
path: combine/publishers/tryfirstwhere
---

# Publishers.TryFirstWhere

A publisher that only publishes the first element of a stream to satisfy a throwing predicate closure.

## Declaration

```swift
struct TryFirstWhere<Upstream> where Upstream : Publisher
```

## Topics

### Creating a try-first-where publisher

- [init(upstream:predicate:)](combine/publishers/tryfirstwhere/init(upstream:predicate:).md)

### Declaring supporting types

- [Publishers.TryFirstWhere.Output](combine/publishers/tryfirstwhere/output.md)
- [Publishers.TryFirstWhere.Failure](combine/publishers/tryfirstwhere/failure.md)

### Inspecting publisher properties

- [upstream](combine/publishers/tryfirstwhere/upstream.md)
- [predicate](combine/publishers/tryfirstwhere/predicate.md)

## Relationships

### Conforms To

- [Publisher](combine/publisher.md)

## See Also

### Selecting specific elements

- [Publishers.First](combine/publishers/first.md)
- [Publishers.FirstWhere](combine/publishers/firstwhere.md)
- [Publishers.Last](combine/publishers/last.md)
- [Publishers.LastWhere](combine/publishers/lastwhere.md)
- [Publishers.TryLastWhere](combine/publishers/trylastwhere.md)
- [Publishers.Output](combine/publishers/output.md)
