# How to Turn SQL Database Columns into Dropdown Menus in Ignition Perspective?

**URL:** <https://forum.inductiveautomation.com/t/how-to-turn-sql-database-columns-into-dropdown-menus-in-ignition-perspective/101531>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 29, 2025, 3:06am UTC](https://forum.inductiveautomation.com/t/how-to-turn-sql-database-columns-into-dropdown-menus-in-ignition-perspective/101531 "2025-01-29T03:06:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshat\_P](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@Akshat\_P](https://forum.inductiveautomation.com/u/Akshat_P)\
**Post date:** [January 29, 2025, 3:06am UTC](https://forum.inductiveautomation.com/t/how-to-turn-sql-database-columns-into-dropdown-menus-in-ignition-perspective/101531/1 "2025-01-29T03:06:02Z")

</div>

I'm working with Ignition Platform 8.1.37 (b2024013011) and seeking guidance on implementing recipe management through SQL Database integration. While I've successfully implemented transactional groups for Loading and Saving recipes, I need advice on configuring recipe selection via dropdown menus.

Specifically, I'd like to populate dropdown menus with recipe information in the format: JobNumber.RecipeName (e.g., 1.Recipe1). Recipe deletion functionality would be a nice-to-have feature, but it's not critical at this stage.

Could someone share best practices or examples for setting up these SQL-based recipe selection dropdowns?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/3/536ccca1b48b66b7e14fa018f006224e0229b9f7.png)  
Like this (I manually added them but need automatically pulled from SQL):  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/4/94f55653c00d10a1924808998fa189eead5a753a.png)

---

<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:** [January 29, 2025, 10:16am UTC](https://forum.inductiveautomation.com/t/how-to-turn-sql-database-columns-into-dropdown-menus-in-ignition-perspective/101531/2 "2025-01-29T10:16:23Z")

</div>

Your recipe names aren't unique.

- ~~What's supposed to be displayed for rows 2 and 4?~~ (Oops, I missed that the display was a concatenation, JobNumber.RecipeName.)
- Why is row 1 full of nulls?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [January 29, 2025, 1:35pm UTC](https://forum.inductiveautomation.com/t/how-to-turn-sql-database-columns-into-dropdown-menus-in-ignition-perspective/101531/3 "2025-01-29T13:35:25Z")

</div>

@Transistor is right, it is very strange that the recipe names are not unique. However, the query would look like this, where `ndx` is the name of the column that has your primary key.

```python
SELECT
    ndx as value,
    concat(Job_number, '. ', Recipe_Name) as label
FROM
    your_table_name

```

You can add a `where` clause to filter the returned data as needed.

---

<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:** [January 29, 2025, 2:25pm UTC](https://forum.inductiveautomation.com/t/how-to-turn-sql-database-columns-into-dropdown-menus-in-ignition-perspective/101531/4 "2025-01-29T14:25:01Z")

</div>

To follow @dkhayes117 recommendation, create a query binding on the dropdown's `PROPS.options` and configure that to use the named query in the query binding path.

The `PROPS.value` will contain the `ndx` column number when a selection is made. (dkhayes is guessing that's the name of that column as it's not visible in the screengrab). You then use that value in a query `WHERE ndx = :index` to return the recipe by passing the dropdown's value property as the `index` parameter into the named query.

---

<div class="post-metadata">

**Author:** ![Akshat\_P](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@Akshat\_P](https://forum.inductiveautomation.com/u/Akshat_P)\
**Post date:** [January 29, 2025, 8:34pm UTC](https://forum.inductiveautomation.com/t/how-to-turn-sql-database-columns-into-dropdown-menus-in-ignition-perspective/101531/5 "2025-01-29T20:34:19Z")

</div>

I am not sure either but I was testing Transactional Group for the first time and I didn't create a database manually. Transactional Group made a database for me.

---

<div class="post-metadata">

**Author:** ![Akshat\_P](https://avatars.discourse-cdn.com/v4/letter/a/ce73a5/32.png) [@Akshat\_P](https://forum.inductiveautomation.com/u/Akshat_P)\
**Post date:** [January 29, 2025, 10:29pm UTC](https://forum.inductiveautomation.com/t/how-to-turn-sql-database-columns-into-dropdown-menus-in-ignition-perspective/101531/6 "2025-01-29T22:29:29Z")

</div>

Thank you for the help. @Transistor @dkhayes117  
Now I am stuck here. Any guidance to achieve this will be very helpful. Thanks in advance!

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/0/509383267de62095b97609f709c51d5a46fec9da.png)

---

<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:** [January 29, 2025, 10:46pm UTC](https://forum.inductiveautomation.com/t/how-to-turn-sql-database-columns-into-dropdown-menus-in-ignition-perspective/101531/7 "2025-01-29T22:46:34Z")

</div>

Go back to your Named Query editor and remove the two parameters. You're not using them.

Later, the dropdown selected value will provide the `recipes_ndx` value as a parameter to another query (to retrieve the recipe) which will have the line,  
`WHERE recipes_ndx = :recipes_ndx`

I recommend that you read [Named Queries | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/platform/sql-in-ignition/named-queries) and the following pages in that section of the documentation as well as watch the Inductive University video on the topic.
