# Using values from controls in string range filter

**URL:** <https://discuss.elastic.co/t/using-values-from-controls-in-string-range-filter/292725>\
**Category:** Kibana\
**Created:** [December 22, 2021, 5:23pm UTC](https://discuss.elastic.co/t/using-values-from-controls-in-string-range-filter/292725 "2021-12-22T17:23:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Ubry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_ubry/32/98104_2.png) [@Michael\_Ubry](https://discuss.elastic.co/u/Michael_Ubry)\
**Post date:** [December 22, 2021, 5:23pm UTC](https://discuss.elastic.co/t/using-values-from-controls-in-string-range-filter/292725/1 "2021-12-22T17:23:30Z")

</div>

Hi,  
I have column where are dates stored as string like this 20212, 20213,20214,20215…..

Now I would like to have controls panel which consists of two dropdown menu FROM and TO, in which user would choose the range of dates which should be applied to data on Dashboard.

Analogically, image there would be column with alphabet A,B,C,D… and I would like user to have option to choose FROM and TO values based on this string column.

I know its possible to do it via query DSL with static values:

```auto
{
  "query": {
    "range": {
      "alphabet": {
        "gt": "A",
        "lt": "D"
      }
    }
  }
}

```

However, I need to use values from dynamic field of controls like this:

```auto
{
  "query": {
    "range": {
      "alphabet": {
        "gt": "value from controls field FROM",
        "lt": " value from controls field TO "
      }
    }
  }
}

```

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/9/0/90677bdc61d06875df9503937ed344ca8c59d19a.png)  
Thank you

---

<div class="post-metadata">

**Author:** ![Michael\_Ubry](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michael_ubry/32/98104_2.png) [@Michael\_Ubry](https://discuss.elastic.co/u/Michael_Ubry)\
**Post date:** [December 29, 2021, 3:09pm UTC](https://discuss.elastic.co/t/using-values-from-controls-in-string-range-filter/292725/2 "2021-12-29T15:09:55Z")

</div>

@dosant Hi, any solution for this?

Is it even possible to use user input as variable for dashboard query?  
What about string range (controls can do only this for numbers)?

Controls is limited vizualization unfortunetally.

Thank you for answers.

---

<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:** [January 26, 2022, 3:10pm UTC](https://discuss.elastic.co/t/using-values-from-controls-in-string-range-filter/292725/3 "2022-01-26T15:10:51Z")

</div>

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