# \[Solved\] How can I improve this manual search functionality in my app?

**URL:** <https://community.thunkable.com/t/solved-how-can-i-improve-this-manual-search-functionality-in-my-app/1983654>\
**Category:** Questions about Thunkable X\
**Tags:** listview, search\
**Created:** [August 2, 2022, 4:42am UTC](https://community.thunkable.com/t/solved-how-can-i-improve-this-manual-search-functionality-in-my-app/1983654 "2022-08-02T04:42:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kartik14](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik14/32/44782_2.png) [@kartik14](https://community.thunkable.com/u/kartik14)\
**Post date:** [August 2, 2022, 4:42am UTC](https://community.thunkable.com/t/solved-how-can-i-improve-this-manual-search-functionality-in-my-app/1983654/1 "2022-08-02T04:42:36Z")

</div>

Hi everyone! I am getting 3800+ google sheets records converted into JSON, from the custom apps script I built into my google sheet. I display the JSON data I get into a normal listviewer by parsing the JSON into list items. The data displays perfectly, which is good. I also have a search functionality built for my list viewer, whose blocks are as follows -

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/9/b9a1b9692984843d3fb29ce54847fba981ef9e54.png)

The variable `raw list` contains the 3800+ rows I am showing into my listviewer, parsed from the JSON response. As you can see, currently I have a for loop which iterates through the list to find rows with matching keywords, entered into the search textbox.

When I tried to test the search module on my device the app freezes for some time and quits. This might be due to the for loop having too much data to go through - so I need to make this search process efficient, so my app doesn’t slow down every time the search function is executed. Does anyone have any ideas on performing an efficient search on large data like I have? Any guidance is appreciated! Thanks 🙂

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [August 2, 2022, 5:33am UTC](https://community.thunkable.com/t/solved-how-can-i-improve-this-manual-search-functionality-in-my-app/1983654/2 "2022-08-02T05:33:00Z")

</div>

Is it possible for you to do the search within the Google Sheet instead? Because it would probably be faster to update a cell with the search term and then get back a set of value from a different cell that has the search formula.

---

<div class="post-metadata">

**Author:** ![manyone](https://avatars.discourse-cdn.com/v4/letter/m/ee59a6/32.png) [@manyone](https://community.thunkable.com/u/manyone)\
**Post date:** [August 2, 2022, 9:59am UTC](https://community.thunkable.com/t/solved-how-can-i-improve-this-manual-search-functionality-in-my-app/1983654/3 "2022-08-02T09:59:47Z")

</div>

i made this demo - is this the kind of search you are doing?  
the link is a live project link  
[https://x.thunkable.com/projects/62e8d867d0918b0bd0014f65/369828ae-e3a8-4e73-9214-46128865d0e8/designer](https://x.thunkable.com/projects/62e8d867d0918b0bd0014f65/369828ae-e3a8-4e73-9214-46128865d0e8/designer)

it’s reading a 2500+ row spreadsheet , each row consisting of seven words, at least one of those words is the spelling of the numbers 1-13, which will be the keys you search for.  
here’s the link to the spreadsheet:

> **[phrase\_table](https://docs.google.com/spreadsheets/d/1hN2Kr31GjEOB8x-Y-k7MNWZcG3ZdyGtvoSdiHLAh_Mc/edit?usp=sharing)**
>
> This Sheet is private

note: it doesnt read the excel as a datasource . it’s reading it using the technique described here:  
read more about it here:

> [@Quiz App using google sheet via google's visualization API Query Language (instead of Data Source)](https://community.thunkable.com/t/quiz-app-using-google-sheet-via-googles-visualization-api-query-language-instead-of-data-source/1866448):
>
> i’ve just recoded my earlier quiz app which used airtable as datasource into a new version using google sheet as source of the quiz but NOT as a data source. Instead i’m using Google’s Visualization API Query Language to read the worksheet (see this recent [discussion](https://community.thunkable.com/t/get-data-from-google-sheets-without-using-the-data-source-blocks/1863069/9) in the forum ). It’s a different approach for working with google sheets, but i like it! below is the contents of my worksheet. ( Note - in order to use the query language, the worksheet must first be shared such that anyone wit…

---

<div class="post-metadata">

**Author:** ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)\
**Post date:** [August 2, 2022, 11:35am UTC](https://community.thunkable.com/t/solved-how-can-i-improve-this-manual-search-functionality-in-my-app/1983654/4 "2022-08-02T11:35:16Z")

</div>

Hey @kartik14

You may want to consider finding a way to query against your db such as the method provided by @manyone or using a db like xano/supabase/airtable that you can truly query against.

You can do searches with the google sheet method but it’s not efficient or scalable when compared to the true ability to search/restrain results from your database via an api call.

My latest app utilizes firebases firestore and several cloud functions to “do the dirty work” of all my CRUD actions. Makes searches easy as pie and I know you know some code. If you wanna hop on a public call sometime I can show you/a small group how to set up your first function in the Firebase cloud and execute a query against firestore data!

I’d only do this if there was interest from a small crowd of folks.

Should only take an hour or so

---

<div class="post-metadata">

**Author:** ![kartik14](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/kartik14/32/44782_2.png) [@kartik14](https://community.thunkable.com/u/kartik14)\
**Post date:** [August 11, 2022, 11:08am UTC](https://community.thunkable.com/t/solved-how-can-i-improve-this-manual-search-functionality-in-my-app/1983654/5 "2022-08-11T11:08:38Z")

</div>

Thanks everyone for replying! (sorry for the delayed reply, I was caught up with exams)

* * *

@manyone your method works the best for me - I didn’t know about this querying method on google sheets - I’m going to use it every time now! When I replaced your spreadsheet’s ID in blocks with mine, it didn’t work and threw a Oauth error - I then made my spreadsheet shared (anyone with the link can view option), and it started working 😄

@jared I haven’t tried Xano and supabase yet, but I’ll give them a try too 🙂 thanks for the recommendation!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [November 9, 2022, 11:09am UTC](https://community.thunkable.com/t/solved-how-can-i-improve-this-manual-search-functionality-in-my-app/1983654/6 "2022-11-09T11:09:28Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
