Filter & list only subcategories on Firebase DB

I simply want to make a list viewer of the items with the arrows.
I would think there must be some simple solution.

I searched several different posts and none of them were the exact question that I have, although there were some answers that seemed promising but once I tried them they didn’t work for my list viewer.

I tried the following posts with no resolve, not exactly sure if that post would apply to my question though.

Thank you Thunkers!

1 Like

Use
getprops

For the cloud variable containing “username/jimbo/task”

Thanks, not sure if this is what you mean but I have put this together and I’m not populating the list with anything.

Thanks again @muneer

1 Like

What is the content of cloud variable task ?

If the cloud variable is pointing to task in Firebase then the block you showed will result in duplicates in your list viewer

Nothing, it is just an initialized cloud variable. I would assume it’s grabbing the data from the tree?

If you are showing your data in a list viewer then you don’t need the loop.

App variable will not work. It has to be cloud variable.

Sorry I saw that and have since changed it to cloud but it still does not work

I changed it properly to cloud but I get nothing in my list viewer still.

Are my blocks arranged how you described here?

Use
getprops

For the cloud variable containing “username/jimbo/task”

1 Like

You don’t need the loop [for each item…].

Your list viewer should be outside the [for each item j in list]

Ok I have removed it from that but nothing has changed. Could you produce it properly and send a screenshot of the blocks perhaps?

Thank you again sir

1 Like

Sure

I’m out now but will do it later and post the blocks and the results.

I created a firebase structure similar to yours

image

I created a screen with only a list viewer and the only code is this

When I run the project, this is the result

Hope this makes it clear.

That’s it thank you very much! One last thing, in the photo, what if I wanted to only see those tasks which had a property of “wood” ?

Thanks again

1 Like

In this case you need to loop through the list and check the availability of “wood” and add it to another list.

After that just assign the newly created list to the list viewer.

Happy Thunking

I’ll be honest I’m lost there, is this a for each item j?
Or is this an in list component?

Thank you for all your help so far

1 Like

For each item j…

If you want I can do a sample tomorrow and post the code?

That would be fine or if you could walk me through it more I can attempt to get it right in the meantime?

1 Like

I have added a few things in the screen. Basically a label, a test input and another list viewer.

If you click on any of the listed item on the above list, the lower list will show the details of that item.

But if you type anything in the text field then the lower list will display only the items that contain the entered text.

If the text entered is not found in any item then you get

Is this what you are looking for?
See the blocks (not optimized but works)


Let me know if you require any explanation

You might also look at Filter JSON List of Objects - Solved - #3 by drted

2 Likes

I have this and used a variation of it in one of my apps. Many thanks for your many inputs

1 Like