Hi all ,
I am working on a use case wherein I require that country names are auto-suggested on typing the initial characters of the country. But my code is not behaving as expected and the suggested countries are not accurate. Please go through it. Any help is much appreciated.
The interface rule is as follows :
placeholder: "--Type to search for country--",
The suggest function used here is
Thanks in advance,
Just as a preliminary piece of advice: when posting long code such as this, please use the built-in functionality here on community, "Insert" -> "Insert Code", and then paste your code in the box you're provided. This preserves formatting and indentation, as well as allowing long code to scroll in its own little window, increasing overall visibility on the post. I believe you can also edit the original post and make this change if you feel like playing with it.
At first glance, I notice you're using the "includes" operator in your one Query Filter in the Suggest Function. This will cause the query to return any country containing the letter(s) typed by the user, i.e. if the first letter typed by the user is "a", it will at first query every country with an "a" in its name, whether or not it starts with "a" - so everything from "argentina" to "uganda" etc.
If your intent is that the user query matches the start of the country name, you should use the "starts with" operator instead.
Thanks for the suggestion. Have edited the post :)
Thank you for the help !
So just to confirm, were you able to get it to work? (If my answer solved your issue, it would help me and others if you click Verify above)
Discussion posts and replies are publicly visible
© 2020 Appian. All rights reserved.