# Set Table List to Near Selected Value

**URL:** <https://forum.inductiveautomation.com/t/set-table-list-to-near-selected-value/28829>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [October 4, 2019, 1:44pm UTC](https://forum.inductiveautomation.com/t/set-table-list-to-near-selected-value/28829 "2019-10-04T13:44:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![boyergary](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/boyergary/32/10316_2.png) [@boyergary](https://forum.inductiveautomation.com/u/boyergary)\
**Post date:** [October 4, 2019, 1:44pm UTC](https://forum.inductiveautomation.com/t/set-table-list-to-near-selected-value/28829/1 "2019-10-04T13:44:55Z")

</div>

I’m trying to get a table List to position closest to a selected value. The user can type in a partial name of something on the list in a text field, and the list will position to the closest match.

For example, say I ask someone to type a word in a text field. I then want to open a table List populated with an alphabetized list of word and position to the closest word that matches their input. Similar to autocomplete, but with a separate table List that positions to the closest line.

I know I can do this by looking through the underlying dataset I’m using to populate the list and set the index value for the table List, but I was looking for something “built-in”.

Thanks,

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [October 4, 2019, 6:44pm UTC](https://forum.inductiveautomation.com/t/set-table-list-to-near-selected-value/28829/2 "2019-10-04T18:44:52Z")

</div>

the bisect library might help you out.

```python
import bisect

listIn = ['constitute', 'eflux', 'intrigue', 'sedge', 'stem', 'whim']

valueIn = 'intr'

bisectValue = bisect.bisect(listIn, valueIn) 

print 'Nearest value:', listIn[bisectValue]

```

 ![2019-10-04_14-43-54](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/4d85e05e32f9ae32c1ef74f09b13c152f77af6d7.png)
