Auto-complete box with Integer Fields
There is an input form in one of our workflows that has been using a combo box to make sure the user enters a valid store number. We would like to switch it to an auto-complete box (per user request, especially iPad users). When testing it out, the dropdown for the auto-complete is always empty. It works ok with text fields (ex. street address - 123 Main St), it's just the integer fields that are giving me trouble. Do I need to set it up differently?
I currently have StoreNum LIKE '{0}%' as the Where Clause on the autocomplete box. It returns results where I query the rest endpoint of my map service, but returns nothing in the dropdown of the autocomplete. Hoping I don't have to add a text field to the table or cast it as a text field in a view to accomplish this...
Thanks in advance,
Stephanie
0
-
@Stephanie - Is the StoreNum field from a joined table or is it an actual field in the table? 0 -
Hi Tom -
It's an actual field in the table - - no joins at all - - and it's a long integer. I've tried it on some other map services with integer fields and I'm gettting the same empty results. I just can't seem to get auto-complete text boxes to load with numeric data.0 -
Change your query string to: CAST(StoreNum AS varchar(100)) LIKE '{0}%'
This will cast the integer to a string and let you execute the LIKE. You can reduce the length of the varchar to whatever the maximum store number may be.0 -
Thank you, Tom! 0
Please sign in to leave a comment.
Comments
4 comments