Dictionary Format of Data Retrieve from Firebase

What is the format of data in the dictionary would be look like if I’ll retrieve data from firebase? When I want to access keys, I only receive Place1, Place2, and Place3. What happened to tags such as “title”?

Additionally, how to remove double quotation from the value?

image

image

Edit: Added image of blocks.

You have to use look for the pair key, make a list , walk at all level + required tag name
Dictionary (already you have)

1 Like

You can use either web or like this
IMG_20211129_082309

I just showed, like this you can design.

1 Like

Thank you, and, I have this set of blocks. What will be format of this in the “data” dictionary?

EDIT: I mean, this.
image

All of your firebase values saved as a dictionary in in the global variable. And you have to look for the key value from this global data dictionary only you can use any label to catch what is present in the dictionary value or you can click the Do it after connecting with companion

1 Like

Okay, thank you. I’ll just ask what will be the output of this? Was the global title and image variable a list or dictionary?

As per your structure, the result is dictionary… based on my suggestion, the result is individual list…

Both will do good. No issue. Only usage of blocks will vary

1 Like

I mean, I want to reply to the blocks you sent. What will be the output of of those blocks? Was the global title and image variable a list or dictionary?

Value of Title from Each tag(Place1, Place2… and so on) comes out as a list…

1 Like

Index 1 of global title will give you title value of the tag place1, likewise you can get it ,but the fact is you need to confirm the order of tags obtained from your firebase. Sometime random will come and you need to order it before proceeding this process. Always use do it function to cross check everytime

1 Like

Sigh Limited replies.

What’s wrong with this?

Runtime Error

Argument #1 () to ‘com.google.appinventor.components.runtime.util.YailDictionary.walkKeyPath(com.google.appinventor.components.runtime.util.YailObject,java.util.List)’ has wrong type (java.lang.String) (java.lang.String cannot be cast to com.google.appinventor.components.runtime.util.YailObject)

image

image

image

I think i can smell your problem. You must keep the project bucket empty. The above error is due to empty list…

image

I redesigned the block to remove the " in each item of the list picker…

image

1 Like

I see. A nice way of retrieving data from Firebase. Links that are stored in Firebase has “\” backslash and I have managed to replace it. Thank you.

One last thing, can you show me the block of stored data in the “data” dictionary base on my main topic? I don’t know how’s the structure of that. I just want to learn for the next purposes.

Storing time only you could see but retrieving g time it won’t appear.

Json format only it will be stored in firebase

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.