How to show specific information from a table of real time firebase database

okay I understand the question seems unclear and confusing so let me explain

So with this snippet

I get this result
Screenshot 2024-06-06 153815

Now how do I make a blocks so that I can access information inside the items from simple list??

Now I have tried this

and this results to this

Now when I clicked on any city the result was same, but I want ciy specific results to appear

Here is my database
Screenshot 2024-06-06 163622

what do I do?

This works to break out the data like you want, you just need to refactor it to work on the list item click like you want.


I tried the blocks and I seemed to have missed something
here are my blocks and their result


I also tried not putting anything in those initialized app variables and even tried putting their values null
Screenshot 2024-06-07 182628

I want to access list specific elements when I click on the items
example say I click on mumbai then I want to access info in mumbai in my database which would be CNN

You have the wrong block in your setup when setting the temp value.

Use get object properties of “j” …not get property of object “j”

So I fixed the mistake, and I still seem to be missing something

all other things are same in the app and database

I would do a hard refresh on your browser (ctrl+shift+r) or (cmd+shift+r) and verify the block change, and then try running the app again.

I’ve had issues with blocks not actually changing and having to force the cache to reload before I could see changes.

I’ll take another look at the blocks and see if I can see if I missed something too.

Another possiblity is that I translated the JSON wrong. Here’s what I setup based on your example image:

{“city”: {“kolhapur”:{“library”:{“BBC”:“”}},“mumbai”:{“CNN”:“”},“pune”:{“BCC”:“”}}}

so your JSON is right and I have restarted my device too but the problem still has not been solved.

I still see a blank screen, I’m not very sure what the issue might be but mean while can you explain the code block that you had given so that based on the logic if I make changes from my side I might see right results

Does this make sense to you?

I moved some of the operations out of the getData function, but the process is the same.

So get data gives me values in both list when screen opens right?

now what would be the process to make sure that the other list only shows the media when clicked on city

so when mumbai clicked → show CNN

Simply by using the index of the item clicked from the city list.

Since this is a single text string you could assign it as the Text of a Label component or button or were appropriate for your needs.

hey it works but I had to make some changes from my side for it work

but still appreciate you feedbacks and responses
thanks

1 Like