[mobile] How to Search Auto Complete from API Rest?

[mobile] How to Search Auto Complete from API Rest?

  

I want to add search auto complete in my apps. But for the data i get it from API REST. And most of the tutorial is search auto complete from database. Anyone know how to move the data from API REST to database or local database in mobile application?

Create a local table with the fields you need from the rest interface, run it once, do an insert all in the local table and do the autosearch on the local table, but maybe its better to not do something like that.. not really a nice solution. 


Regards,

Wim

Wim van den Brink wrote:

Create a local table with the fields you need from the rest interface, run it once, do an insert all in the local table and do the autosearch on the local table, but maybe its better to not do something like that.. not really a nice solution. 


Regards,

Wim


Why is it not really nice solution?

Hi Eron,

It is not totally dependent upon database rather it requires a list return by search it can be via a query or other way.

What you can do is you can in onchange you can use ListFilter action on your original list and whatever you get return form it you can assign it to autocomplete list .



It will be same like refreshing a query based on search filter.Try this and let me know if you face any problem.


Regards

-PJ-

If the rest api has a search field, you could directly search using the rest api iso loading a local table, also when there is a lot of data it will slow down the start of your search screen. Next, when you do a fill table on the entry of the screen if the user switches back and forth through the screen it will generate a lot of data call's. 

But it all depends on the amount of data the rest api will deliver and how much that data changes .. I had a project where upon first start of the app in a day a local table would be filled with about 20 to 40k records to enable the users to search offline in a products table, this was controlled by a local settings table with the last load date. The product list wouldn't change a lot during the day and the users knew we didn't have everything in offline mode, just the most important stuff. 

So .. to recap, it all depends on the amount of data and volatility of it, if you do it be sure to understand the data and the pitfalls you can have with it. Downloading it all can be handy for some situations if you control the way it works by for example have a last download setting in a local table and just do a download when the last one was over one hour ago (or more)


regards

Wim  

PRAMOD JAIN wrote:

Hi Eron,

It is not totally dependent upon database rather it requires a list return by search it can be via a query or other way.

What you can do is you can in onchange you can use ListFilter action on your original list and whatever you get return form it you can assign it to autocomplete list .



It will be same like refreshing a query based on search filter.Try this and let me know if you face any problem.


Regards

-PJ-


How to add filter like "data.name like "%"+search+"%" " on this?