# Connect data with Custom Query depending on state

**URL:** https://forum.builder.io/t/connect-data-with-custom-query-depending-on-state/15228
**Category:** Technical Questions
**Tags:** visual-editor
**Created:** [June 19, 2025, 3:51pm UTC](https://forum.builder.io/t/connect-data-with-custom-query-depending-on-state/15228 "2025-06-19T15:51:48Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![JerLin](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.builder.io/jerlin/32/5064_2.png) [@JerLin](https://forum.builder.io/u/JerLin)
#### Post date: [June 19, 2025, 3:51pm UTC](https://forum.builder.io/t/connect-data-with-custom-query-depending-on-state/15228/1 "2025-06-19T15:51:48Z")

</div>

Hi,

I’m building a Qwik app which is a basic website, but where i can switch between different datasets. In that dataset, i got navigation infos (links in the navbar are supposed to change when switching dataset).  
So i have a section for my navbar in Builder UI, where i want to repeat a clickable text item for each navigation item.  
So i need to query the right dataset depending on a property in the state of my navbar section.  
In Classic UI Mode, i added an entry in Connect Data with a custom query (single result), “where Name \> Custom Query \> {”$eq": state.navName}  
But it always return the same dataset which is the first in the set of all my datasets, whatever state.navName is.  
What am i doing wrong ?

Here is the state in my section :

1. state: {navigation: Object, isBrowser: true, isServer: false, location: Object}

2. ▶navigation: Object

```
1. ▶data: Object

  1. ▶links: Array(2)

    1. ▶0: Object

      1. url: "sdfsdf"

      2. label: "L'équipe"
    2. ▶1: Object

      1. url: "#"

      2. label: "L'agence"

```

1. isBrowser: true

2. isServer: false

3. ▶location: Object

**Builder content link**

> **[Builder.io: Visual Development Platform](https://builder.io/content/2c8e0181c9504461b6e9094a0a978b3d)**
>
> Builder is an AI-Powered Visual Development Platform that helps teams generate, iterate, and optimize web and mobile experiences in seconds instead of sprints.

**Builder public api key**  
32a9ddc3b21b41788dd2af5128ac8678
