# Display text based on 'value'

**URL:** <https://forum.inductiveautomation.com/t/display-text-based-on-value/107883>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [June 27, 2025, 2:05pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883 "2025-06-27T14:05:44Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaerrydairy](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chaerrydairy](https://forum.inductiveautomation.com/u/chaerrydairy)\
**Post date:** [June 27, 2025, 2:05pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/1 "2025-06-27T14:05:44Z")

</div>

I am trying to populate a drop down filter based on clicking on a row of a table. I got the value to change but am trying to figure out how to make that value actually display. I am using a binding to change the value but cant figure out how to add that text field to it

I am trying to learn ignition for the first time and working on fixing some projects that some people have left me

---

<div class="post-metadata">

**Author:** ![dillon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dillon/32/81537_2.png) [@dillon](https://forum.inductiveautomation.com/u/dillon)\
**Post date:** [June 27, 2025, 2:07pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/2 "2025-06-27T14:07:19Z")

</div>

Do you have a script that changes the `props.value` property on the dropdown, or a binding on it that derives it from something else?

---

<div class="post-metadata">

**Author:** ![chaerrydairy](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chaerrydairy](https://forum.inductiveautomation.com/u/chaerrydairy)\
**Post date:** [June 27, 2025, 2:07pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/3 "2025-06-27T14:07:42Z")

</div>

Yes I do, I have a props.data[value]

---

<div class="post-metadata">

**Author:** ![dillon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dillon/32/81537_2.png) [@dillon](https://forum.inductiveautomation.com/u/dillon)\
**Post date:** [June 27, 2025, 2:09pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/4 "2025-06-27T14:09:31Z")

</div>

Nice, and does this value property match one of the objects in the `props.options` list?

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

---

<div class="post-metadata">

**Author:** ![chaerrydairy](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chaerrydairy](https://forum.inductiveautomation.com/u/chaerrydairy)\
**Post date:** [June 27, 2025, 2:10pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/5 "2025-06-27T14:10:26Z")

</div>

I do not have anything in the options list

---

<div class="post-metadata">

**Author:** ![dillon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dillon/32/81537_2.png) [@dillon](https://forum.inductiveautomation.com/u/dillon)\
**Post date:** [June 27, 2025, 2:30pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/6 "2025-06-27T14:30:47Z")

</div>

Assuming you are talking about the Perspective dropdown component, you must have the options in the dropdown be all of the selectable options for the user. If that options property is empty, nothing will display no matter what the value is. Below is a link for the documentation on the component.

[Perspective - Dropdown | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/components/perspective-components/perspective-input-palette/perspective-dropdown#properties)

---

<div class="post-metadata">

**Author:** ![chaerrydairy](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chaerrydairy](https://forum.inductiveautomation.com/u/chaerrydairy)\
**Post date:** [June 27, 2025, 2:35pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/7 "2025-06-27T14:35:38Z")

</div>

Thank you so much

---

<div class="post-metadata">

**Author:** ![chaerrydairy](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chaerrydairy](https://forum.inductiveautomation.com/u/chaerrydairy)\
**Post date:** [June 27, 2025, 2:44pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/8 "2025-06-27T14:44:30Z")

</div>

I have created a binding on the options to populate the array but it does not switch. The text on it remains as the placeholder. I can see that the props.value is set to the correct option but it doesnt actually display it

---

<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:** [June 27, 2025, 2:59pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/9 "2025-06-27T14:59:11Z")

</div>

Find your dropdown in the Project Browser, right-click, copy and paste it in here so we can see the full setup. Please see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831).

---

<div class="post-metadata">

**Author:** ![chaerrydairy](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chaerrydairy](https://forum.inductiveautomation.com/u/chaerrydairy)\
**Post date:** [June 27, 2025, 4:30pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/10 "2025-06-27T16:30:15Z")

</div>

```python
[
  {
    "type": "ia.input.dropdown",
    "version": 0,
    "props": {
      "placeholder": {
        "text": "Select a line..."
      },
      "style": {
        "color": "#000000",
        "marginBottom": 10,
        "marginTop": 10
      }
    },
    "meta": {
      "name": "NameDropdown"
    },
    "position": {
      "basis": "225px"
    },
    "custom": {},
    "propConfig": {
      "props.enabled": {
        "binding": {
          "config": {
            "path": "...../LocationCategoryContainer/AssetDisplay.custom.Editable"
          },
          "type": "property"
        }
      },
      "props.options": {
        "binding": {
          "config": {
            "path": "...../LocationCategoryContainer/AssetDisplay.props.data"
          },
          "transforms": [
            {
              "code": "\tlines = []\n\tcheck_for_duplicates = set()\n\tfor row in value:\n\t\tline = row['Line_Name']\n\t\tlineID = row['Line_ID']\n\t\tif line not in check_for_duplicates:\n\t\t\tnew_entry = {'label': line, 'value': lineID}\n\t\t\tlines.append(new_entry)\n\t\t\tcheck_for_duplicates.add(line)\n\treturn lines",
              "type": "script"
            }
          ],
          "type": "property"
        }
      },
      "props.value": {
        "binding": {
          "config": {
            "path": "...../LocationCategoryContainer/AssetDisplay.props.selection.selectedRow"
          },
          "transforms": [
            {
              "code": "\tif value > -1:\n\t\treturn self.parent.parent.parent.parent.getChild(\"LocationCategoryContainer\").getChild(\"AssetDisplay\").props.data[value]['Line_Name']\n\treturn ''",
              "type": "script"
            }
          ],
          "type": "property"
        },
        "onChange": {
          "enabled": null,
          "script": "\tself.getSibling(\"IDDisplay\").props.text = self.props.value"
        }
      }
    }
  }
]

```

---

<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:** [June 27, 2025, 4:47pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/11 "2025-06-27T16:47:20Z")

</div>

You didn't read the link as requested, did you?

---

<div class="post-metadata">

**Author:** ![chaerrydairy](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chaerrydairy](https://forum.inductiveautomation.com/u/chaerrydairy)\
**Post date:** [June 27, 2025, 5:52pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/12 "2025-06-27T17:52:19Z")

</div>

I thought I had set it to code but I didnt, my mistake

---

<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:** [June 27, 2025, 6:05pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/13 "2025-06-27T18:05:02Z")

</div>

You're generating the options from a binding which we can't replicate. Can you post the contents of `...../LocationCategoryContainer/AssetDisplay.props.data` (formatted as code)?

---

<div class="post-metadata">

**Author:** ![dillon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dillon/32/81537_2.png) [@dillon](https://forum.inductiveautomation.com/u/dillon)\
**Post date:** [June 27, 2025, 6:06pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/14 "2025-06-27T18:06:28Z")

</div>

> [@Transistor](#):
>
> we can't replicate

This. But also reading your code, looks like you are referencing the `Line_Name` as the selected value, where you need to have it be the `Line_ID` since that is what you are setting as the value in your options binding here:

```python
new_entry = {'label': line, 'value': lineID}

```

The value is not going to be linked to a label.

---

<div class="post-metadata">

**Author:** ![dillon](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dillon/32/81537_2.png) [@dillon](https://forum.inductiveautomation.com/u/dillon)\
**Post date:** [June 27, 2025, 6:07pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/15 "2025-06-27T18:07:38Z")

</div>

Does this work? Should be able to copy this and then paste it into your designer

> **Potentially Fixed Dropdown Component**
>
> ```json
> [
> {
> "type": "ia.input.dropdown",
> "version": 0,
> "props": {
> "placeholder": {
> "text": "Select a line..."
> },
> "style": {
> "color": "#000000",
> "marginBottom": 10,
> "marginTop": 10
> }
> },
> "meta": {
> "name": "NameDropdown"
> },
> "position": {
> "basis": "225px"
> },
> "custom": {},
> "propConfig": {
> "props.enabled": {
> "binding": {
> "type": "property",
> "config": {
> "path": "...../LocationCategoryContainer/AssetDisplay.custom.Editable"
> }
> }
> },
> "props.options": {
> "binding": {
> "type": "property",
> "config": {
> "path": "...../LocationCategoryContainer/AssetDisplay.props.data"
> },
> "transforms": [
> {
> "code": "\tlines = []\n\tcheck_for_duplicates = set()\n\tfor row in value:\n\t\tline = row['Line_Name']\n\t\tlineID = row['Line_ID']\n\t\tif line not in check_for_duplicates:\n\t\t\tnew_entry = {'label': line, 'value': lineID}\n\t\t\tlines.append(new_entry)\n\t\t\tcheck_for_duplicates.add(line)\n\treturn lines",
> "type": "script"
> }
> ]
> }
> },
> "props.value": {
> "binding": {
> "type": "property",
> "config": {
> "path": "...../LocationCategoryContainer/AssetDisplay.props.selection.selectedRow"
> },
> "transforms": [
> {
> "code": "\tif value > -1:\n\t\treturn self.parent.parent.parent.parent.getChild(\"LocationCategoryContainer\").getChild(\"AssetDisplay\").props.data[value]['Line_ID']\n\treturn ''",
> "type": "script"
> }
> ]
> },
> "onChange": {
> "script": "\tself.getSibling(\"IDDisplay\").props.text = self.props.value",
> "enabled": null
> }
> }
> }
> }
> ]
> 
> ```

---

<div class="post-metadata">

**Author:** ![chaerrydairy](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chaerrydairy](https://forum.inductiveautomation.com/u/chaerrydairy)\
**Post date:** [June 27, 2025, 6:19pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/16 "2025-06-27T18:19:38Z")

</div>

Im afraid I cant post the contents of the options themselves

---

<div class="post-metadata">

**Author:** ![chaerrydairy](https://avatars.discourse-cdn.com/v4/letter/c/35a633/32.png) [@chaerrydairy](https://forum.inductiveautomation.com/u/chaerrydairy)\
**Post date:** [June 27, 2025, 6:22pm UTC](https://forum.inductiveautomation.com/t/display-text-based-on-value/107883/17 "2025-06-27T18:22:48Z")

</div>

That worked! Thank you so much for the help
