# Vega-Lite and multiple conditions

**URL:** <https://talk.observablehq.com/t/vega-lite-and-multiple-conditions/10425>\
**Category:** Help\
**Created:** [June 1, 2025, 3:59pm UTC](https://talk.observablehq.com/t/vega-lite-and-multiple-conditions/10425 "2025-06-01T15:59:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![PBrockmann](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/pbrockmann/32/1552_2.png) [@PBrockmann](https://talk.observablehq.com/u/PBrockmann)\
**Post date:** [June 1, 2025, 3:59pm UTC](https://talk.observablehq.com/t/vega-lite-and-multiple-conditions/10425/1 "2025-06-01T15:59:45Z")

</div>

Hi,

I cannot figure out how to combine 2 conditions with an logical OR with a simple Vega-Lite code.

> **[Brush](https://observablehq.com/@pbrockmann/brushtest)**

```auto
//vl.opacity().if(selectOrigin, vl.value(1.0)).value(0.2),
vl.opacity().if(brush, vl.value(1.0)).value(0.2),

```

Each line is correct. But I would like both.  
Opacity set to 0.2 in the plot1 when an item from plot2 is selected or when brush from plot1 is active.

I have tried answer from chatGTP without success.

```auto
vl.opacity().condition("brush && selectOrigin", { value: 1.0 }, { value: 0.1 }),

```

produces:

```auto
TypeError: Cannot read properties of undefined (reading 'not')

```

Any help is welcome.

---

<div class="post-metadata">

**Author:** ![PBrockmann](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/pbrockmann/32/1552_2.png) [@PBrockmann](https://talk.observablehq.com/u/PBrockmann)\
**Post date:** [June 1, 2025, 5:35pm UTC](https://talk.observablehq.com/t/vega-lite-and-multiple-conditions/10425/2 "2025-06-01T17:35:12Z")

</div>

I have found the answer.

```auto
const selectAnd = vl.and(selectBrush, selectOrigin);

```
