# Perspective drop down\_ on Select Event

**URL:** <https://forum.inductiveautomation.com/t/perspective-drop-down-on-select-event/71296>\
**Category:** Ignition\
**Tags:** perspective, vision\
**Created:** [March 20, 2023, 6:47am UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-on-select-event/71296 "2023-03-20T06:47:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [March 20, 2023, 6:47am UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-on-select-event/71296/1 "2023-03-20T06:47:06Z")

</div>

Hi,  
In perspective mode, I have a dropdown and text box in my screen, on selection of item and entering some data into screen and I am trying to insert the entered data into data base. I have done this in Vision.

but in Perspective I am not getting scripting. please guide.

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/e/8e25aa1a9454e54813cfe44b49f172bc155a5b24.png)

below is the vision script:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/a/6a5e6e80d0ce757c92c8f4a105ca8be353a1c7d9.png)

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [March 24, 2023, 3:36am UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-on-select-event/71296/2 "2023-03-24T03:36:31Z")

</div>

Perspective is completely different than Vision. If you want a selectedStringValue for your dropdown, you will have to create one. Fortunately, it's not that difficult to do.  
• First, add a custom property to your dropdown called selectedStringValue:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/f/9feac08af707dbc83d7a397d8381ddb6546598b0.png)  
• Then, click the binding icon next to the custom property  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/1/11bc641ccc79edabf4a5f6e10f89bf402536bc8c.png)  
• Bind the selectedStringValue custom property to the value property of the dropdown:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/2/42fb73a138f23039a49535c939c9ea872edf8dd3.png)  
• Before closing the Edit Binding Dialog Box, click the Add Transform button and select Script:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/4/44165b353a419db7a63046a33db79d7d859e709c.png)  
• Add the following script, and **click Apply** before closing the Edit Binding Dialog Box:

```auto
#def transform(self, value, quality, timestamp):
	selectedStringValue = ''
	for index in range(len(self.props.options)):
		if self.props.options[index].value == value:
			selectedStringValue = str(self.props.options[index].label)
			break
	return selectedStringValue

```

The script will loop through the options and return the corresponding selected string value property that can be used in other scripting.

Just remember to give each of your options a unique value:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/4/74f6b338077c75673539acfe6d9877903ab70bbf.png)

---

<div class="post-metadata">

**Author:** ![kavya\_shree](https://avatars.discourse-cdn.com/v4/letter/k/b4bc9f/32.png) [@kavya\_shree](https://forum.inductiveautomation.com/u/kavya_shree)\
**Post date:** [March 24, 2023, 7:44am UTC](https://forum.inductiveautomation.com/t/perspective-drop-down-on-select-event/71296/3 "2023-03-24T07:44:09Z")

</div>

Thank you so much. I will try. let you know
