# how to get text value from value list based type ahead

**URL:** https://forum.servoy.com/t/how-to-get-text-value-from-value-list-based-type-ahead/11100
**Category:** Classic Servoy
**Created:** [August 31, 2009, 4:41pm UTC](https://forum.servoy.com/t/how-to-get-text-value-from-value-list-based-type-ahead/11100 "2009-08-31T16:41:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![eKelman](https://avatars.discourse-cdn.com/v4/letter/e/c89c15/32.png) [@eKelman](https://forum.servoy.com/u/eKelman)
#### Post date: [August 31, 2009, 4:41pm UTC](https://forum.servoy.com/t/how-to-get-text-value-from-value-list-based-type-ahead/11100/1 "2009-08-31T16:41:06Z")

</div>

Hi,

I have a type ahead styled field. It is based on a value list. The value list displays a name and the dataprovider is an id value.

I am looking for a way to get the textual value(displayed value) from a typeahead style field using an id number as the value.

Example. fld1 is a typeahed… the user types “hello”…the text value is hello, but the id is 1. I am looking to retrieve “hello” programmatically.  
None of the following work for me…  
elements.fld1  
eval(elements.fld1 ).valueOf()  
foundset.fld1  
fld1  
elements[‘fld1’].text  
elements.fld1.getSelectedText()  
forms.form1.fld1"  
forms.form1.fld1.substr(0)  
forms.form1.fld1.equals()  
forms.form1.fld1.toString()  
eval(forms.form1.fld1)  
forms.form1.fld1.valueOf()

How exactly can I do that?

thank you.

---

<div class="post-metadata">

### Author: ![sanneke](https://avatars.discourse-cdn.com/v4/letter/s/f9ae1b/32.png) [@sanneke](https://forum.servoy.com/u/sanneke)
#### Post date: [September 1, 2009, 7:32am UTC](https://forum.servoy.com/t/how-to-get-text-value-from-value-list-based-type-ahead/11100/2 "2009-09-01T07:32:09Z")

</div>

Hi,

There is a function to do that:

application.getValueListDisplayValue(valuelistName,realValue)

Sanneke

---

<div class="post-metadata">

### Author: ![eKelman](https://avatars.discourse-cdn.com/v4/letter/e/c89c15/32.png) [@eKelman](https://forum.servoy.com/u/eKelman)
#### Post date: [September 1, 2009, 6:04pm UTC](https://forum.servoy.com/t/how-to-get-text-value-from-value-list-based-type-ahead/11100/3 "2009-09-01T18:04:56Z")

</div>

Thank you that worked perfectly!!!
