# Why do strings from a dropdown component get truncated in SQL query

**URL:** <https://forum.inductiveautomation.com/t/why-do-strings-from-a-dropdown-component-get-truncated-in-sql-query/111218>\
**Category:** Ignition\
**Created:** [October 6, 2025, 5:23pm UTC](https://forum.inductiveautomation.com/t/why-do-strings-from-a-dropdown-component-get-truncated-in-sql-query/111218 "2025-10-06T17:23:22Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [October 6, 2025, 5:23pm UTC](https://forum.inductiveautomation.com/t/why-do-strings-from-a-dropdown-component-get-truncated-in-sql-query/111218/1 "2025-10-06T17:23:22Z")

</div>

I am working on the ignition gold cert practice test. I ran into an odd error where the value of my staff\_id dropdown does not seem to be passing correctly. I am running this script:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/c/1c392431b6395181e2804d01dea7f935d51bdd2e.png)

and getting this error:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/1/51497688ee2206611de2b9a575337e9b9966f93d.png)

It seems to be truncating the value to the first character, but I can’t figure out why. The data type in the database is varchar like the other strings:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/1/315892ee81261ace8e7db0acd22935727e31d8ba.png)

What am I missing?

---

<div class="post-metadata">

**Author:** ![Ryan\_Deardorff](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan_deardorff/32/63815_2.png) [@Ryan\_Deardorff](https://forum.inductiveautomation.com/u/Ryan_Deardorff)\
**Post date:** [October 6, 2025, 5:36pm UTC](https://forum.inductiveautomation.com/t/why-do-strings-from-a-dropdown-component-get-truncated-in-sql-query/111218/2 "2025-10-06T17:36:55Z")

</div>

The varchar type has a length associated with it, so I'm guessing you have it defined as length 1.

---

<div class="post-metadata">

**Author:** ![Rob\_Lapkass](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Rob\_Lapkass](https://forum.inductiveautomation.com/u/Rob_Lapkass)\
**Post date:** [October 6, 2025, 5:47pm UTC](https://forum.inductiveautomation.com/t/why-do-strings-from-a-dropdown-component-get-truncated-in-sql-query/111218/3 "2025-10-06T17:47:21Z")

</div>

Hi Daniel: have another look at the prompt for the staff\_id field datatype, it is listed as an INT to correlate with the user source users table.

---

<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:** [October 6, 2025, 6:10pm UTC](https://forum.inductiveautomation.com/t/why-do-strings-from-a-dropdown-component-get-truncated-in-sql-query/111218/4 "2025-10-06T18:10:46Z")

</div>

Welcome to the forum, Rob!

---

<div class="post-metadata">

**Author:** ![Daniel\_Whitlock](https://avatars.discourse-cdn.com/v4/letter/d/8edcca/32.png) [@Daniel\_Whitlock](https://forum.inductiveautomation.com/u/Daniel_Whitlock)\
**Post date:** [October 7, 2025, 2:50pm UTC](https://forum.inductiveautomation.com/t/why-do-strings-from-a-dropdown-component-get-truncated-in-sql-query/111218/5 "2025-10-07T14:50:23Z")

</div>

Thanks, I appreciate the help!
