# Canvas dropdownControl default value

**URL:** https://discuss.elastic.co/t/canvas-dropdowncontrol-default-value/193114
**Category:** Kibana
**Tags:** canvas
**Created:** [July 31, 2019, 12:20pm UTC](https://discuss.elastic.co/t/canvas-dropdowncontrol-default-value/193114 "2019-07-31T12:20:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![BennyInc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bennyinc/32/21751_2.png) [@BennyInc](https://discuss.elastic.co/u/BennyInc)
#### Post date: [July 31, 2019, 12:20pm UTC](https://discuss.elastic.co/t/canvas-dropdowncontrol-default-value/193114/1 "2019-07-31T12:20:11Z")

</div>

I am using the [dropdownControl](https://www.elastic.co/guide/en/kibana/6.8/canvas-common-functions.html#_dropdowncontrol) to select which of our stages I want to see data on:

```auto
csv data="stage
prod
stg
int
test"
| dropdownControl valueColumn="stage" filterColumn="fields.stage"
| render 

```

Now I want to set a default value, so that users opening the Canvas for the first time would get a specific value selected. Is that possible?

I would like to combine this with the [urlparam](https://www.elastic.co/guide/en/kibana/6.8/canvas-client-functions.html#_urlparam) function so that I can link users to a specific stage, but still allow them to select a different one later on.

---

<div class="post-metadata">

### Author: ![BennyInc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bennyinc/32/21751_2.png) [@BennyInc](https://discuss.elastic.co/u/BennyInc)
#### Post date: [July 31, 2019, 12:23pm UTC](https://discuss.elastic.co/t/canvas-dropdowncontrol-default-value/193114/2 "2019-07-31T12:23:01Z")

</div>

I just checked the Canvas Workpad JSON and see that this stored as part of the object:

```auto
{
	"id": "dropdown",
	"position": {
		"left": 1754.75,
		"top": 122.375,
		"width": 153,
		"height": 50,
		"angle": 0,
		"parent": null
	},
	"expression": "csv data=\"stage\nprod\nstg\nint\ntest\"\n| dropdownControl valueColumn=\"stage\" filterColumn=\"fields.stage\"\n| render \n css=\".canvasRenderEl select {\n color: #bbb;\n border-color: #bbb;\n background-color: #000;\n}\n\n.canvasRenderEl svg {\n color: #bbb\n}\"",
	"filter": "exactly value=\"test\" column=\"fields.stage\""
}

```

So I guess this is something that is stored within the Canvas workpad, and cannot easily be overridden?

---

<div class="post-metadata">

### Author: ![clintandrewhall](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/clintandrewhall/32/45435_2.png) [@clintandrewhall](https://discuss.elastic.co/u/clintandrewhall)
#### Post date: [July 31, 2019, 7:06pm UTC](https://discuss.elastic.co/t/canvas-dropdowncontrol-default-value/193114/3 "2019-07-31T19:06:37Z")

</div>

Good morning, Benny! Yeah, it doesn't look like the [`dropdownControl`](https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/canvas/canvas_plugin_src/functions/common/dropdownControl.ts#L59) function allows for a default to be specified, at least at the moment.

I would recommend opening an [enhancement request](https://github.com/elastic/kibana/issues/new?template=Feature_request.md) to add `defaultValue` as an `arg` to `dropdownControl`. That would get [passed on](https://github.com/elastic/kibana/blob/master/x-pack/legacy/plugins/canvas/canvas_plugin_src/renderers/dropdown_filter/index.tsx#L85) to `dropdown_filter` as its `value`, (assuming it was was present in the collection.

Feel free to refer to this post in your enhancement request. Cheers!

---

<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: [August 28, 2019, 7:06pm UTC](https://discuss.elastic.co/t/canvas-dropdowncontrol-default-value/193114/4 "2019-08-28T19:06:37Z")

</div>

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