How to create a search function from tinydb?

Hi, im adding a search function from my contact database(tinydb). Here’s what i have attempted soo far.

The app crashes when implementing this. Could someone show me the proper way?

What do you mean by crash?

Does it show errors? if so you can post here

it does not, the app immediatly errors shown so im not sure

I think the first “if” block is text box text lenght != 0, and the second “if” is using “contains text” downcase of get contact_tags

use logcat to find out what happens


1 Like

I have solved the crashing issue it was due to the value of the textbox equal to 0 so i changed it to more than zero and now it is fixed. But now im having issues on retrieving the data from tiny db. It cant retrieve data and gives out not found error. Here’s the updated version

What is the error and what is your tinydb data looks like?

According to me, I am not sure if I am right,
The TinyDB getvalue should have Select list item from list “contact_data” of index “number”.

Nd accordingly it should be add item to list
“Phone Numbers”

1 Like

it consist of name and phone number. The error is data is not found

let me check

The first one is how i store the data, second is how i would call the search function but not working. the third is the error im receiving. Can someone help me on this?

I Wasn’t Saying this
I meant to say like this

1 Like

answer this:

why you set your textbox.text to “close”?

everytime the text box get filled the search icon will change to close icon

look at your own blocks, anything changed on Text_Box1, you set Text_Box1.Text to “close”. Perhaps you mean set Clear_all.Text to “close”

1 Like

try This. I was Suggesting you to do this

1 Like

trying it now

just want to confirm how would the image+listview would receive the data?

The app crashes immediately, the way i called the blocks incorrect?

Not like this Buddy. pls PM me your AIA I will fix and give