# Cascading dropdowns in Perspective

**URL:** <https://forum.inductiveautomation.com/t/cascading-dropdowns-in-perspective/67162>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [December 1, 2022, 6:57pm UTC](https://forum.inductiveautomation.com/t/cascading-dropdowns-in-perspective/67162 "2022-12-01T18:57:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hw79](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hw79](https://forum.inductiveautomation.com/u/hw79)\
**Post date:** [December 1, 2022, 6:57pm UTC](https://forum.inductiveautomation.com/t/cascading-dropdowns-in-perspective/67162/1 "2022-12-01T18:57:58Z")

</div>

I'm sure this is all noob stuff, but I'm trying to make a dropdown dependent on the selection of another dropdown. The first dropdown is populated from a SQL query and filters the table data, I'd like to get the second dropdown to further filter the data but I can't get it to work.

---

<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:** [December 1, 2022, 7:13pm UTC](https://forum.inductiveautomation.com/t/cascading-dropdowns-in-perspective/67162/2 "2022-12-01T19:13:41Z")

</div>

You might get the best help with some more information, screenshots, code snippets, queries, etc.

Use preformatted text button to enter code.

Welcome to the forum.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [December 1, 2022, 7:33pm UTC](https://forum.inductiveautomation.com/t/cascading-dropdowns-in-perspective/67162/3 "2022-12-01T19:33:43Z")

</div>

The second dropdown would itself have its options bound against a parameterized Named Query, where the parameter is supplied as the value of the first Dropdown.

I use something _like_ this for some of our testing pages:

**Dropdown 1 Named Query binding for `options`:**  
Named Query SQL: `select id as value, type as label from component_types`  
This returns something like `[{"value": "1", "label": "input"}, {"value": "2", "label": "display"}]`, and allows my options to immediately be populated with the expected keys present. I also always change the return format of the binding to JSON, but that's just preference for easier examination of the returned results.

**Dropdown 2 Named Query binding on `options`:**  
`select component from components where components.typeId=:typeId`  
Then my binding dialog allows me to specify the parameter value, and I select the `value` of Dropdown 1.

---

<div class="post-metadata">

**Author:** ![hw79](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hw79](https://forum.inductiveautomation.com/u/hw79)\
**Post date:** [December 1, 2022, 10:13pm UTC](https://forum.inductiveautomation.com/t/cascading-dropdowns-in-perspective/67162/4 "2022-12-01T22:13:49Z")

</div>

Sorry, I actually figured it out. Typical bozo move. I had to set the value of the variable in the query to the prop\>value of the first dropdown.

```auto
SELECT 
	DISTINCT Attribute1, Attribute2,
	CONCAT(Attribute1,'-',Attribute2) AS CombAttrib
FROM Inventory
WHERE "Location" = :LOC

```

then the LOC value needed set to:

```auto
{../Dropdown.props.value}

```

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [December 1, 2022, 10:21pm UTC](https://forum.inductiveautomation.com/t/cascading-dropdowns-in-perspective/67162/5 "2022-12-01T22:21:25Z")

</div>

So... exactly what I said to do?

---

<div class="post-metadata">

**Author:** ![hw79](https://avatars.discourse-cdn.com/v4/letter/h/838e76/32.png) [@hw79](https://forum.inductiveautomation.com/u/hw79)\
**Post date:** [December 2, 2022, 6:50pm UTC](https://forum.inductiveautomation.com/t/cascading-dropdowns-in-perspective/67162/6 "2022-12-02T18:50:11Z")

</div>

Maybe, possibly, probably, yes, thank you!

I apologize, I honestly got lost in your reply because I'm not familiar enough with Ignition.

Best regards,

--H
