# Fast record find

**URL:** <https://community.thunkable.com/t/fast-record-find/2713300>\
**Category:** Questions about Thunkable X\
**Created:** [November 21, 2023, 8:13am UTC](https://community.thunkable.com/t/fast-record-find/2713300 "2023-11-21T08:13:50Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![rusticone](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rusticone/32/163435_2.png) [@rusticone](https://community.thunkable.com/u/rusticone)\
**Post date:** [November 21, 2023, 8:13am UTC](https://community.thunkable.com/t/fast-record-find/2713300/1 "2023-11-21T08:13:50Z")

</div>

Ciao!

I have a (Google) table with 1000 records and more. The record is composed by some fields:

- IDcustomer;
- MonthOfPayment;
- AmountPayed
- DateOfPayment
- (etc…)

In my page I have inputted the **IDcustomer** code and the **MonthOfPayment**.  
Please, what is the fastest way to check if the IDCustomer-MonthOfPayment I have on my page is present in the table?

Grazie!!

---

<div class="post-metadata">

**Author:** ![Goldking](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/goldking/32/165073_2.png) [@Goldking](https://community.thunkable.com/u/Goldking)\
**Post date:** [November 21, 2023, 11:10am UTC](https://community.thunkable.com/t/fast-record-find/2713300/2 "2023-11-21T11:10:46Z")

</div>

Ciao 👋  
Show also the code you 're using now . Which is the worst time you got ?

---

<div class="post-metadata">

**Author:** ![rusticone](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rusticone/32/163435_2.png) [@rusticone](https://community.thunkable.com/u/rusticone)\
**Post date:** [November 22, 2023, 8:29am UTC](https://community.thunkable.com/t/fast-record-find/2713300/3 "2023-11-22T08:29:55Z")

</div>

Ciao!!  
This is what I do by now:

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

As you can see, I scan the table from the first record till the end or till I found what I search for. My question is: can I create an index of that table where I can chain to and have immediately the answer for my query?

The best performance should be less than 1 sec.

Grazie!

---

<div class="post-metadata">

**Author:** ![Goldking](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/goldking/32/165073_2.png) [@Goldking](https://community.thunkable.com/u/Goldking)\
**Post date:** [November 22, 2023, 9:58am UTC](https://community.thunkable.com/t/fast-record-find/2713300/4 "2023-11-22T09:58:36Z")

</div>

Ciao caro ,  
Yesterday I tested my app with apk and it was very slow 😔 web preview and apk have the same time .  
Probably you can delete some variables in your code but I think the big problem is the query form sheet.  
For fast search I think you have to use 2 data base .  
1 on line , with sheet, so you can use it from all the device and 1 local to read data faster.  
When app starts you retrieve all data and save them in a local dB and use it as you are doing now with sheet .  
Every time you make changes you have to update sheet too.  
👋🏻👋🏻

---

<div class="post-metadata">

**Author:** ![rusticone](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rusticone/32/163435_2.png) [@rusticone](https://community.thunkable.com/u/rusticone)\
**Post date:** [November 22, 2023, 11:44am UTC](https://community.thunkable.com/t/fast-record-find/2713300/5 "2023-11-22T11:44:28Z")

</div>

Ciao amico!

Mamma mia! what a terrible scenario!!!

Let me understand: using remote DB is a way to slow user experience?? For my app is not possible to follow your kind suggestion: I could have multiple users using and modifying siultanely the same tables…

Maybe is the Google sheets slow? I should have to use other platforms?

Grazie!!!

---

<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:** [November 22, 2023, 12:52pm UTC](https://community.thunkable.com/t/fast-record-find/2713300/6 "2023-11-22T12:52:58Z")

</div>

Use algolia for your searches.

---

<div class="post-metadata">

**Author:** ![tthompson41231](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tthompson41231/32/161401_2.png) [@tthompson41231](https://community.thunkable.com/u/tthompson41231)\
**Post date:** [November 22, 2023, 4:34pm UTC](https://community.thunkable.com/t/fast-record-find/2713300/7 "2023-11-22T16:34:59Z")

</div>

Set two lists (or more if needed) to the columns you want to search in when the screen opens. Now all your data is on the phone and you won’t have iterate through a table.

Performance Time: Instant

Edit: That index variable value can also be used as a row id if you need to write data back to your table or get a row object.

 ![FastVlookup](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/d/0d754270765a5f9d8cbe0326eb7a0ab7a1b89633.png)

---

<div class="post-metadata">

**Author:** ![Goldking](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/goldking/32/165073_2.png) [@Goldking](https://community.thunkable.com/u/Goldking)\
**Post date:** [November 22, 2023, 7:57pm UTC](https://community.thunkable.com/t/fast-record-find/2713300/8 "2023-11-22T19:57:45Z")

</div>

As @tthompson41231 wrote you can retrieve the 3 list ad save them in local , then start with for each. In this way you have only one call to dB and not multiple calls from for each. You can try .  
Probably with a lot of users retrieve all the data is not a good solution but a part of them could be a good way.

---

<div class="post-metadata">

**Author:** ![rusticone](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/rusticone/32/163435_2.png) [@rusticone](https://community.thunkable.com/u/rusticone)\
**Post date:** [November 23, 2023, 8:05am UTC](https://community.thunkable.com/t/fast-record-find/2713300/9 "2023-11-23T08:05:54Z")

</div>

All your suggestions were welcome, and your examples let me know more about Thunkable.  
I’ll try do do my best to resolve with your inputs, but I have to chek if work on tables in local that could be have edited by other user is dangerous…  
Grazie!

---

<div class="post-metadata">

**Author:** ![Goldking](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/goldking/32/165073_2.png) [@Goldking](https://community.thunkable.com/u/Goldking)\
**Post date:** [November 23, 2023, 8:23am UTC](https://community.thunkable.com/t/fast-record-find/2713300/10 "2023-11-23T08:23:47Z")

</div>

I hope to add a screenshot as soon as possible, follow the example of tthompson41231 but retrieve data not under open screen but at the beginning of the search code.

1. retrieve ID , ID cliente , mese and save it in variable
2. start search code

In this way you make only 3 instant call to sheet and work in local with search code , this is faster than call sheet for each item in list .

👋🏻

---

<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:** [February 21, 2024, 8:23am UTC](https://community.thunkable.com/t/fast-record-find/2713300/11 "2024-02-21T08:23:55Z")

</div>

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