I have a (Google) table with 1000 records and more. The record is composed by some fields:
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?
Show also the code you 're using now . Which is the worst time you got ?
This is what I do by now:
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.
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?
Use algolia for your searches.
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.
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.
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…
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.
- retrieve ID , ID cliente , mese and save it in variable
- 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 .