Using Index function to filter a list

Hi ,


I'm Using Reactive Auto Complete component (reactive web app) for autocomplete of data.

The problem is i have used index function on a list of data that need to filter when user enters a text in input and populates the dropdown with user enter text .

I'm able to filter the data , but I need the user entered text to match with the chars from the beginning of the word

For Example , If I enter In , it need to show countries that start with In (India etc.,)

Index function: https://success.outsystems.com/Documentation/How-to_Guides/Logic/How_to_find_out_if_a_string_is_contained_in_another_string

Reactive Auto Complete Forge: https://www.outsystems.com/forge/component-overview/8300/reactiveautocomplete



mvp_badge
MVP

Hi Nikhileswar, 


For that you can have a simpler way than using ListIndex.

For instance, if Text is the country names you want to search and SearchKeyword is the input the user typed, you can use the following:


Substr(Text, 0, Length(SearchKeyword)) = SearchKeyword


In your example, it would compare the first two letters of each country name to the In the user wrote down. It would therefore return India but not Argentina.


Kind Regards,
João

Hi ,

I look over the component, and I think is not possible. The component uses the index function to search the input text in the text.

Try to contact the component owner, if he has plans to change that.


Meanwhile, I just changed the component and added a new input parameter to what you want. Just be careful, if the owner updates the component and you also, you will lose this change. Maybe clone it and name it differently.


Regards,

Luis Oliveira

ReactiveAutoComplete.oml

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.