# Canvas dropdown control doesn't work as I expected

**URL:** https://discuss.elastic.co/t/canvas-dropdown-control-doesnt-work-as-i-expected/289786
**Category:** Kibana
**Created:** [November 22, 2021, 8:44am UTC](https://discuss.elastic.co/t/canvas-dropdown-control-doesnt-work-as-i-expected/289786 "2021-11-22T08:44:22Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![marekpowwm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marekpowwm/32/97372_2.png) [@marekpowwm](https://discuss.elastic.co/u/marekpowwm)
#### Post date: [November 22, 2021, 8:44am UTC](https://discuss.elastic.co/t/canvas-dropdown-control-doesnt-work-as-i-expected/289786/1 "2021-11-22T08:44:22Z")

</div>

I try to create a dropdown control inside the canvas. I created a data source and previewed it:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/3/43f7ba0089cef0bc6a37c1764af1301c2e7ea135.png)

And next, I tried to set up the display for this control:

![image](https://us1.discourse-cdn.com/elastic/original/3X/a/d/adfb59a5d91c7166a42176b2d47bc17df8544a50.png)

But nothing was displayed on the canvas when I clicked on this control:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/0/5/059c5b1ff6b9f17f22a832d08b8107f3819f9384.png)

Who knows what was wrong and how to improve the configuration of this control so it can be able to display needed data?

---

<div class="post-metadata">

### Author: ![marekpowwm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marekpowwm/32/97372_2.png) [@marekpowwm](https://discuss.elastic.co/u/marekpowwm)
#### Post date: [November 22, 2021, 12:50pm UTC](https://discuss.elastic.co/t/canvas-dropdown-control-doesnt-work-as-i-expected/289786/2 "2021-11-22T12:50:59Z")

</div>

I found such a thing in the Kibana documentation

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/d/2/d23c05d5b4326888cc49fe238af8dfa5ec83a91a.png)

I don't understand, why in this query string after var keyword value of variable indexName is used instead of indexName variable? It makes no sense with the concept of variables.

I tried to apply that approach to my canvas dropdown control, I switched to query expression and I wrote my query using the above concept:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/3/b381ea1aa2a75e0d7dcee6f6ef80c98c621da683.png)

What is wrong? Why there is no error description? I found canvas designer very poor. Why my the dropdown control doesn't have expected data from the SQL query?

---

<div class="post-metadata">

### Author: ![tsullivan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tsullivan/32/31077_2.png) [@tsullivan](https://discuss.elastic.co/u/tsullivan)
#### Post date: [December 2, 2021, 8:52pm UTC](https://discuss.elastic.co/t/canvas-dropdown-control-doesnt-work-as-i-expected/289786/3 "2021-12-02T20:52:35Z")

</div>

> [@marekpowwm](#):
>
> I don't understand, why in this query string after var keyword value of variable indexName is used instead of indexName variable? It makes no sense with the concept of variables.

I think you are right - it looks like there is a bug in the 2nd screenshot in the documentation. I don't know why else it would look like `var "my_new_index_name"`.

> [@marekpowwm](#):
>
> Why my the dropdown control doesn't have expected data from the SQL query?

I'm not seeing this problem you describe. It may be something with the data source or a filter on the worksheet.

I don't think having a variable in the essql query will help - it sounds like you don't have the same use case that is covered in that section of the documentation.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [December 30, 2021, 8:53pm UTC](https://discuss.elastic.co/t/canvas-dropdown-control-doesnt-work-as-i-expected/289786/4 "2021-12-30T20:53:22Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
