Search Bar With Data Viewer List

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

Good luck!

1 Like

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.

ERROR 1:




Using a tutorial/demo project, I used the code, but strangely it doesn’t work here. I know something is wrong but I don’t know what.

Please help. Thanks!

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

Keep us posted!

2 Likes

ah ok. thanks a lot. I will do this.

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.

Some help?
My Blocks:

Thanks!

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

1 Like

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

Is this one working as you expect?

Try to loop slower. Add a short Wait block like 0.1 seconds or 0 seconds (yes, that’s still a delay) and see if that works to create rows.

tested that and it just lists down all the row values

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

and for some others, it even showed 5 times

here is my app link, make sure to go to the destinations page:
https://x.thunkable.com/copy/e8ba5ebbaf4f3d876d0d09d94b9422e7

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.

Modified project link: Thunkable

1 Like

hi @tatiang, thanks for the help. I tried your modified project, however, when I pressed backspace, multiple entries popped up again.

once again thanks a lot for the help.

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.

1 Like

is there a block for if data list viewer contains…

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.

1 Like

would you know how to do so? cause i have no clue… my data does come from airtable