Hey guys, hope all is well.
Is it possible to make a search bar with a data viewer list, because i know how to do it with a simple list but not a data viewer list as i cannot find the designated blocks.
I would very much appreciate some help please. thanks!
Hello, it’s pretty much the same thing, there are already loads of topics in the community about the “search bar”.
What i suggest is to have a dive into those first and have a go.
As first step you need to select a “Data Viewer” from the menu and drag it to the screen, once done you’ll be asked in the right panel where you want to gather you data from, either google spreadsheet, local table, airtable and more…
Start from there and i’m sure you’ll find your way easily
Hi @maurizio.polverini89, thanks for the reply. I have taken a look at some of the forums and wow! There are indeed a lot of questions about it. So I have taken a look at one of the forums and copied the code from it but edited it to my data sources. However I have encountered an error with it. I’m really new at data handling in Thunkable and just got started exploring it.
What i suggest is to break down your blocks and, instead of doing everything together and expect a final result, you do every little step using a Label of debug.
What i mean is, make sure every step is resulting what you expect to result and then move forward.
Unplug all the blocks, starting from the beginning and try to place the Label2 every other action, for example to see “searchStringList”, “AllNameList”, ecc…
Doing so you’ll know what it’s wrong, that the first step of fixing
Hey @maurizio.polverini89,
I have tested my search bar, and the first time, it worked! however, i tried it again the second time but it didnt work. I looked at every single variable but couldnt find any bugs.
There are many ways to see where the error is, try with this one first:
Just on the beginning, inside the "for each item CurrentRow in list, as first block add a "Set Label2 Text to “CurrentRow” - this must be placed before the “IF DOES CONTAIN”
This will tell you if the app is effectively scanning all the items you want. You might need to set a “wait 0.3 seconds” block as well just after the block suggested
If the label2 efficently scans the words you want, i’d add a “set Label2 text to YES” between the “IF DOES CONTAIN” and the “create row in ViewList” - so you’ll have a label that says “YES” if the text in the imput is found in the CurrentRow variable.
I’d also add a “Set Label2 to NO” on the “ELSE” of the same block (you need to add it)
This should be a good starting point for a debug
Sorry i can’t access to thunkable right now, but i’m sure you’ll get what i said
Thank you @maurizio.polverini89 for the speedy reply.
tested it but every input (except if the text input was empty) resulted in the message NO, however I have checked my data sources, and input something that IS in the data source from my table
strange, without the delay, it creates 3 of the same items (e.g. i search abu dhabi, it shows 3 abu dhabi’s) with it saying matched: 0. However with the short delay, it did the same without the delay but it said matched: 3
Part of the problem is that as you are typing “Barcelona”, for example, the event block is triggered by “B” and “Ba” and “Bar” etc. so it’s going to run multiple times.
I’ve had a little more success with this but I notice if I type at a normal speed, it makes a mistake and shows multiple entries for Barcelona. If I go slowly, it shows only one entry.
My demo is by no means a perfect working example. I just think it moves you forward a bit. There’s still more to do and hopefully someone else here can help with the next steps.
No. If you’re using something like Google Sheets or Airtable, you can create a formula for that in the spreadsheet and then access the cell with that value from Thunkable. But with a local database, you can’t do that.