# Populate a "Numeric Text Field" using a "Drop down List" that is looking at a DB

**URL:** <https://forum.inductiveautomation.com/t/populate-a-numeric-text-field-using-a-drop-down-list-that-is-looking-at-a-db/34075>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [April 21, 2020, 1:53pm UTC](https://forum.inductiveautomation.com/t/populate-a-numeric-text-field-using-a-drop-down-list-that-is-looking-at-a-db/34075 "2020-04-21T13:53:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mhicks1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mhicks1/32/14121_2.png) [@mhicks1](https://forum.inductiveautomation.com/u/mhicks1)\
**Post date:** [April 21, 2020, 1:53pm UTC](https://forum.inductiveautomation.com/t/populate-a-numeric-text-field-using-a-drop-down-list-that-is-looking-at-a-db/34075/1 "2020-04-21T13:53:30Z")

</div>

Good Morning. I am trying to populate a Numeric Text Field (Memory Tag) using a drop down list that is pointing at a DB File. I think I have the drop down list set up correctly to show the values I want  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/d382904343d7c099c5e21258e1c8aa715585ac71.png)

Now I am stuck getting the selected value to populate into the Numeric Text Field.

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

My drop down list and the Numeric text field are in separate templates. Does it make more sense to put the drop down on my template where the Numeric Field is?

Thank you for any input.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 21, 2020, 4:02pm UTC](https://forum.inductiveautomation.com/t/populate-a-numeric-text-field-using-a-drop-down-list-that-is-looking-at-a-db/34075/2 "2020-04-21T16:02:18Z")

</div>

You’re going to have a hard time putting a prefix like AD or RB into a numeric text field. You technically can:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/ee50caffdf7c813d516c911389b2c6c6fa36db0d.png)  
But it requires customizing the number format property, and it won’t manually edit ‘cleanly’; you can enter the same prefix that’s already defined, and it will be ignored, but you can’t change it by editing the text field.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/e97c1a8caf9e346bca25e56e731293c586e32371.png)

A formatted text field is probably closer to what you want; a regex pattern like `[A-Z]{2}\d{5}` will only allow two uppercase letters, then five digits, which will do at least a basic level of input validation.

---

<div class="post-metadata">

**Author:** ![mhicks1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mhicks1/32/14121_2.png) [@mhicks1](https://forum.inductiveautomation.com/u/mhicks1)\
**Post date:** [April 21, 2020, 4:04pm UTC](https://forum.inductiveautomation.com/t/populate-a-numeric-text-field-using-a-drop-down-list-that-is-looking-at-a-db/34075/3 "2020-04-21T16:04:26Z")

</div>

Yes. You are correct…LOL I started down a different path originally. I should just turn that into a label field that excepts strings.??

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 21, 2020, 4:05pm UTC](https://forum.inductiveautomation.com/t/populate-a-numeric-text-field-using-a-drop-down-list-that-is-looking-at-a-db/34075/4 "2020-04-21T16:05:56Z")

</div>

Yeah, a label is probably your best bet if you don’t want any input. You can also use a regular text field but mark it not editable in the properties if you prefer that appearance.

---

<div class="post-metadata">

**Author:** ![mhicks1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mhicks1/32/14121_2.png) [@mhicks1](https://forum.inductiveautomation.com/u/mhicks1)\
**Post date:** [April 21, 2020, 4:07pm UTC](https://forum.inductiveautomation.com/t/populate-a-numeric-text-field-using-a-drop-down-list-that-is-looking-at-a-db/34075/5 "2020-04-21T16:07:16Z")

</div>

Then would I just bind the value selected to mt Label Tag?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 21, 2020, 4:09pm UTC](https://forum.inductiveautomation.com/t/populate-a-numeric-text-field-using-a-drop-down-list-that-is-looking-at-a-db/34075/6 "2020-04-21T16:09:21Z")

</div>

Since you’ve already got a dropdown, bind the label’s text value to the `selectedValue` property on your dropdown; or, if you’re using tags throughout, use those. Be wary that if you’re using a regular tag, not a client tag, all clients will ‘share’ the same value - one user switching the dropdown will update all other open clients to that value.

---

<div class="post-metadata">

**Author:** ![mhicks1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mhicks1/32/14121_2.png) [@mhicks1](https://forum.inductiveautomation.com/u/mhicks1)\
**Post date:** [April 21, 2020, 4:11pm UTC](https://forum.inductiveautomation.com/t/populate-a-numeric-text-field-using-a-drop-down-list-that-is-looking-at-a-db/34075/7 "2020-04-21T16:11:02Z")

</div>

I am using a Memory tag to hold the values. I am also using indirect tags to display where Each material is located. BD1, BD2, etc

---

<div class="post-metadata">

**Author:** ![mhicks1](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mhicks1/32/14121_2.png) [@mhicks1](https://forum.inductiveautomation.com/u/mhicks1)\
**Post date:** [April 21, 2020, 7:20pm UTC](https://forum.inductiveautomation.com/t/populate-a-numeric-text-field-using-a-drop-down-list-that-is-looking-at-a-db/34075/8 "2020-04-21T19:20:50Z")

</div>

Thank you for your help.
