# Get selected text in dropdown component

**URL:** <https://forum.inductiveautomation.com/t/get-selected-text-in-dropdown-component/67612>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [December 14, 2022, 3:03pm UTC](https://forum.inductiveautomation.com/t/get-selected-text-in-dropdown-component/67612 "2022-12-14T15:03:35Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![craigb](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@craigb](https://forum.inductiveautomation.com/u/craigb)\
**Post date:** [December 14, 2022, 5:37pm UTC](https://forum.inductiveautomation.com/t/get-selected-text-in-dropdown-component/67612/8 "2022-12-14T17:37:19Z")

</div>

Another method..

On the dropdown create a custom property called `displayvalue`.

On the dropdown value prop, right click and add a change script.

```auto
	data = self.props.options
	for row in range(data.getRowCount()):
		if (data.getValueAt(row, "value") == self.props.value):
			self.custom.displayvalue = data.getValueAt(row, "label")
			break

```

That should then update the custom property with the label.

Credit goes to the below, there was another script that took that code a step further that may help.

> [@Perspective drodown selected label](https://forum.inductiveautomation.com/t/perspective-drodown-selected-label/38723):
>
> I want to get the selected label from a perspective dropdown. This post helped… But, if using showClearIcon and then clearing you will get stale data. Are there any better alternatives to getting the selected label?

---

_[View the full topic](https://forum.inductiveautomation.com/t/get-selected-text-in-dropdown-component/67612)._
