# Dropdown question on pespective view

**URL:** <https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790>\
**Category:** Ignition\
**Tags:** perspective, ignition81\
**Created:** [May 23, 2024, 1:02pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790 "2024-05-23T13:02:36Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Donald\_Dahlman](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@Donald\_Dahlman](https://forum.inductiveautomation.com/u/Donald_Dahlman)\
**Post date:** [May 23, 2024, 1:02pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/1 "2024-05-23T13:02:36Z")

</div>

dropdown add and remove  
to add you can  
droplist =   
droplist.append({'label':'hello','value':1})  
droplist.append({'label':'hello2','value':2})  
self.getSibling('Dropdown').props.options = droplist

The syntax to remove is  
dropdown = self.getSibling('Dropdown')  
if "option\_you\_want\_to\_remove" in dropdown.props.options:  
dropdown.props.options.remove("option\_you\_want\_to\_remove")

I can not figure how to option\_you\_want\_to\_remove format and how would  
you know what option\_you\_want\_to\_remove would be

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 23, 2024, 1:08pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/2 "2024-05-23T13:08:28Z")

</div>

Hi, Donald. Please see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831) and hit the pencil icon to edit your post. Otherwise we don't know if it's indented properly.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 23, 2024, 1:23pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/3 "2024-05-23T13:23:31Z")

</div>

Meanwhile, try the code below in Script Console.

> **Script Console demonstration**
>
> ```python
> true = True
> false = False
> 
> input = [
> {
> "value": 0,
> "label": "Option 0",
> "isDisabled": false
> },
> {
> "value": 1,
> "label": "Option 1",
> "isDisabled": false
> },
> {
> "value": 2,
> "label": "Option 2",
> "isDisabled": false
> },
> {
> "value": 3,
> "label": "Option 3",
> "isDisabled": false
> },
> {
> "value": 4,
> "label": "Option 4",
> "isDisabled": false
> },
> {
> "value": 5,
> "label": "Option 5",
> "isDisabled": false
> }
> ]
> 
> valueToBeRemoved = 4
> output = []
> for option in input:
> print option
> if not option['value'] == valueToBeRemoved:
> output.append(option)
> 		
> print output
> 
> ```

(But please fix the formatting in your question. It may help someone in the future.)

---

<div class="post-metadata">

**Author:** ![Donald\_Dahlman](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@Donald\_Dahlman](https://forum.inductiveautomation.com/u/Donald_Dahlman)\
**Post date:** [May 23, 2024, 1:29pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/4 "2024-05-23T13:29:52Z")

</div>

not what I am looking for

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 23, 2024, 1:43pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/5 "2024-05-23T13:43:57Z")

</div>

OK. You haven't explained what's wrong with my answer and you don't seem to be interested in contributing on the site. I don't think I can help further.

---

<div class="post-metadata">

**Author:** ![Donald\_Dahlman](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@Donald\_Dahlman](https://forum.inductiveautomation.com/u/Donald_Dahlman)\
**Post date:** [May 23, 2024, 2:02pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/6 "2024-05-23T14:02:31Z")

</div>

first I thought you were an AI type auto responder. Second I was looking on what the syntax was for the remove command. It would seem you would need to grab the dropdown list entries before you would know the string to look for. I have accessed the manual but as normal it is vague and does not cover all the options with examples.  
So if you append the dropdown with  
droplist.append({'label':'hello','value':1})  
and use the comand  
dropdown.props.options.remove("option\_you\_want\_to\_remove")  
how do you know what should replace "option\_you\_want\_to\_remove"  
with out scanning the list to begin with cause It is not using input command and your example does not use the remove command

---

<div class="post-metadata">

**Author:** ![Ryan\_Ahlstrom](https://avatars.discourse-cdn.com/v4/letter/r/ecb155/32.png) [@Ryan\_Ahlstrom](https://forum.inductiveautomation.com/u/Ryan_Ahlstrom)\
**Post date:** [May 23, 2024, 2:12pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/7 "2024-05-23T14:12:37Z")

</div>

Hi Donald,

How are you getting the 'option\_you\_want\_to\_remove', is this just the selected option in the dropdown or is it being populated from somewhere else?

Assuming you know what the 'option\_you\_want\_to\_remove' is you can traverse the array, find the index (if the option exists) and then use the .pop(index) function to remove that instance.  
[Python Arrays](https://www.w3schools.com/python/python_arrays.asp) is a good resource for array manipulation.

As Transistor mentioned, please post code on the forums in the proper format so we can easily follow it.

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [May 23, 2024, 2:29pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/8 "2024-05-23T14:29:00Z")

</div>

> [@Donald\_Dahlman](#):
>
> I have accessed the manual but as normal it is vague and does not cover all the options with examples.

There are many examples on the Internet. Try a good ole Goog. Your question isn't as much an Ignition thing as it is Python/Jython.

---

<div class="post-metadata">

**Author:** ![Donald\_Dahlman](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@Donald\_Dahlman](https://forum.inductiveautomation.com/u/Donald_Dahlman)\
**Post date:** [May 23, 2024, 2:30pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/9 "2024-05-23T14:30:49Z")

</div>

it was supplied by Ignition as an example

this is what they supplied

---

<div class="post-metadata">

**Author:** ![Ryan\_Ahlstrom](https://avatars.discourse-cdn.com/v4/letter/r/ecb155/32.png) [@Ryan\_Ahlstrom](https://forum.inductiveautomation.com/u/Ryan_Ahlstrom)\
**Post date:** [May 23, 2024, 2:34pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/10 "2024-05-23T14:34:45Z")

</div>

Hi Donald, do you have a link to the example we can review?

---

<div class="post-metadata">

**Author:** ![Donald\_Dahlman](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@Donald\_Dahlman](https://forum.inductiveautomation.com/u/Donald_Dahlman)\
**Post date:** [May 23, 2024, 2:40pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/11 "2024-05-23T14:40:08Z")

</div>

typical

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [May 23, 2024, 2:49pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/12 "2024-05-23T14:49:39Z")

</div>

For anyone considering trying to assist on this thread I recommend a browse through [previous "contributions"](https://forum.inductiveautomation.com/u/donald_dahlman/activity). It's not nice.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 23, 2024, 2:58pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/13 "2024-05-23T14:58:20Z")

</div>

> [@Transistor](#):
>
> It's not nice.

Indeed. I remember some of that.

This advice from one of those seems applicable:

> [@How to justify Ignition to decision makers who are not familiar with the SCADA space](https://forum.inductiveautomation.com/t/how-to-justify-ignition-to-decision-makers-who-are-not-familiar-with-the-scada-space/72845/13):
>
> Don't feed the troll, I don't want this to turn into another topic I have to close.

@Donald_Dahlman : Perhaps you should open a support ticket, so someone gets **paid** to help you. This forum is full of volunteers who don't have to put up with your [expletive].

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 23, 2024, 3:35pm UTC](https://forum.inductiveautomation.com/t/dropdown-question-on-pespective-view/90790/15 "2024-05-23T15:35:16Z")

</div>

Closed on May 23, 2024, 3:35pm UTC


