If I don’t know what kind of data you have and how you store them I can’t help you.
I need to know what is in the variable to check an error
Explain also which is your goal?
Probably your steps could be :
- Retrieve data from air table (ex. Got column)
- Check the list to find the name (search)
- Use this value to get all the values you need in airtable
- Upload data in listview
Is the work flow correct?
I am making a currency converter i am using airtable which is loaded by initialized screen then with listview image and text, when i click on it i but the currency value on a button then by writing the amount i get the result. As there is a lot of currency, I wanted to create a search, with "on changed text I get the result, but it’s when I click on it that I had a problem. Now with the last image, there has an error when I click on image and text without the search.
Ok. You want to convert a currency. Show me which is in listview. All the currencies? And where is the value to convert .
So it doesn’t work if gets error show the text error too
no the error occurs when I click directly on the currency flag and not in search
I no longer have an error, it works, but that’s not what I want. Here in my search, I have the currencies that appear and when I click on them, the currency appears on the button. what I want is to see the country of the currency and when I click on it on my button it is the name of the currency that appears
and in your variable , so I can help you
Now I show some hint for code
This code running in less than 1 sec , why you want to add items to a listview (first for each) and then clear them to show other item? You have to work with variables and use only the last for each to add items in listview . All will work better and fast.
If I read your code correctly after digit on letter in the textbox you will see in list view only the items from global SearchList. Right?
In search list there are only the items that contains text search, so probably the index of the item in device isn’t in the same position of the item in SearchList
But I have to see what you store in global device and other variable.
Why two listview with the same values?
And also I think you can delete this block in the other screenshot
After search you haven’t to use the position in the list device but the device name to find is index in the main list device (use the block index in list thing) . With this index you will find the country in the main list pays
your when textbox on text changed, i dont think you have constructed properly… please tell us how do you store the image, title and text items in global lists…
by deleting what you crossed out I still have the same thing, just the motto.
on the other hand if I don’t go in the search and I click on an image or motto, I have an error message which is: Select list item: Attempt to get item number 1 of a list of length 0: ()
Note: You will not see another error reported for 5 seconds.
Ref this topic for how to create custom search bar for list view with image. Already multiple answers are there
I can make tis for you but i need few bucks for making.
Control all the block and what you got and where you save the data. You call a lot of procedure with no sense , for example as I said you fill a listview and then delete it to fill again in the same procedure .
Here you are working with an empty list and wont to get the first item . So , verify what you have in your variable . I see two Firebase database but only one used . I don’t know how you stored your data. All the informations I asked you are to solve your problems.
in my “on text changed” procedure if I remove “clear list” it no longer works.
moreover if I use 2 listview, this is one for the left side and one for the right side, maybe it is simpler, moreover I have added a listview for the search area. It works
Of course, there you need a clear block