# How to design perspective dropdown property

**URL:** <https://forum.inductiveautomation.com/t/how-to-design-perspective-dropdown-property/56607>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 28, 2022, 7:15am UTC](https://forum.inductiveautomation.com/t/how-to-design-perspective-dropdown-property/56607 "2022-02-28T07:15:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![yifeiliu08](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yifeiliu08](https://forum.inductiveautomation.com/u/yifeiliu08)\
**Post date:** [February 28, 2022, 7:15am UTC](https://forum.inductiveautomation.com/t/how-to-design-perspective-dropdown-property/56607/1 "2022-02-28T07:15:26Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/e/8e14d73313e2a4510f1824ea9f3da29d21b57f08.png)  
I have design a dropdown list, in upside picture the right side show on the label , and the left side line become the dropdown value.

when this mode in vision, I can get the both data from selectedvalue and selectedstringvalue this two components.

but in perspective, I can only find the left line in prop.value , is there some solution can make it similar like vision two value can be get in the property?

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [February 28, 2022, 7:48am UTC](https://forum.inductiveautomation.com/t/how-to-design-perspective-dropdown-property/56607/2 "2022-02-28T07:48:29Z")

</div>

You can construct an array like this in a transform script, where value is an object:

```auto
	returnData = []
	for x in range(value.getRowCount()):
		returnData.append({"label":value.getValueAt(x,1),"value":{"WareHouse":value.getValueAt(x,0),"ToPlace":value.getValueAt(x,1)}})
	return returnData

```

---

<div class="post-metadata">

**Author:** ![jespinmartin1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jespinmartin1/32/57175_2.png) [@jespinmartin1](https://forum.inductiveautomation.com/u/jespinmartin1)\
**Post date:** [February 28, 2022, 4:14pm UTC](https://forum.inductiveautomation.com/t/how-to-design-perspective-dropdown-property/56607/3 "2022-02-28T16:14:25Z")

</div>

Basically you have 2 options, if you are not interested in the int value you just need to filter in the String column you want.

1. Manipulate the options dataset

Use a script transform in your `options` property:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/9/098e9cab6116d135b17df520b9ae07569ebd59d9.png)

And when ever you select an option you will see the string value  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/3/13ce9225340df270c37c8f15859af78a289d513a.png)

1. Create you own property,  
If you need the int value for whatever reason, you can create your own property `stringvalue`.  
Use a property binding using the `prop.value` and apply a script transform.

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

the script in the transform is:

```auto
	options = self.props.options
	if type(value). __name__ == 'JsonifiableArrayList':
		stringvalue = []
		for v in value:
			strvalue = None
			for r in range(options.rowCount):
				if options.getValueAt(r,0) == v:
					strvalue = options.getValueAt(r,1)
					break
			stringvalue.append(strvalue)
	else:
		stringvalue = None
		if value is not None:
			for r in range(options.rowCount):
				if options.getValueAt(r,0) == value:
					stringvalue = options.getValueAt(r,1)
					break
	return stringvalue

```

---

<div class="post-metadata">

**Author:** ![yifeiliu08](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yifeiliu08](https://forum.inductiveautomation.com/u/yifeiliu08)\
**Post date:** [March 1, 2022, 1:44am UTC](https://forum.inductiveautomation.com/t/how-to-design-perspective-dropdown-property/56607/4 "2022-03-01T01:44:13Z")

</div>

it works , thanks a lot

---

<div class="post-metadata">

**Author:** ![yifeiliu08](https://avatars.discourse-cdn.com/v4/letter/y/bbe5ce/32.png) [@yifeiliu08](https://forum.inductiveautomation.com/u/yifeiliu08)\
**Post date:** [March 1, 2022, 1:55am UTC](https://forum.inductiveautomation.com/t/how-to-design-perspective-dropdown-property/56607/5 "2022-03-01T01:55:53Z")

</div>

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/b/8bde8eeca438fdb383f4b06d832495df3f8d69b1.png)  
current status is like this, only 1 value can be read in the props  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/b/0b2b7fd3f4e19c7b9ac0f8267260591e6d445f5c.png)  
what I want is this picture, two value can be binding in the property, that can be realize by [victordcq](https://forum.inductiveautomation.com/u/victordcq) code

---

<div class="post-metadata">

**Author:** ![John\_S1](https://avatars.discourse-cdn.com/v4/letter/j/c0e974/32.png) [@John\_S1](https://forum.inductiveautomation.com/u/John_S1)\
**Post date:** [October 7, 2022, 8:28am UTC](https://forum.inductiveautomation.com/t/how-to-design-perspective-dropdown-property/56607/6 "2022-10-07T08:28:49Z")

</div>

Hi, is it possible to have 2 items in the dropdown, I want in such a way that we do like in vision as list in dropdown, so we will see 2 columns in there, likewise is it possible to have 2 columns like label and value both in the dropdown UI, when we click on the dropdown.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [October 7, 2022, 9:06am UTC](https://forum.inductiveautomation.com/t/how-to-design-perspective-dropdown-property/56607/7 "2022-10-07T09:06:05Z")

</div>

No, not possible, it will only display a single string from the label property.

You'll have to format the labels string to include your second column

---

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [October 7, 2022, 1:18pm UTC](https://forum.inductiveautomation.com/t/how-to-design-perspective-dropdown-property/56607/8 "2022-10-07T13:18:43Z")

</div>

There is an ideas post for the ability to make drop-down elements into embedded views. This would give the desired affect you were looking for

> [@\[FEATURE\] Make dropdown options an embedded view](https://forum.inductiveautomation.com/t/feature-make-dropdown-options-an-embedded-view/64491/7):
>
> Speaking of…
