Yes
congratulations
You should now rebuild the function, I posted in the screenshot above.
Then use realtime_db.get
key: serviceRequests
you will get a value which is the input for the function in my screenshot (Variable: “inputobject”)
unfortunely you will nee 10-20 minutes to build this
Yeah, i just wanted the logic because i understood that you found out the solution. After i do that i will inform you if everything worked as it should. I owe you a beer. Thanks.
youre welcome
@User81, I would strongly suggest recreating your example blocks to use object property getters rather than converting to a JSON string and parsing that string. The object (in your example ‘inputobject’) is already parsed! My guess is that your example blocks would be much much simpler
-Mark
@Mark thank you for your advice.
I think I tried it with object blocks but struggled. I had to put a “property name” in but in a unknown list of nodes it is not possible to put a variable in the property field, yet.
I see. In most situations you know the properties of the JSON/Object that you are dealing with but it sounds like perhaps that is not the case for your example. We definitely need to add the ability to specify a dynamic property name in the property getter and setter blocks, as well as a way to get all the property names from an object. I’ve added that to our internal bug queue.
-Mark
Hi,
When i press the testbutton nothing happens to PROVE. When i put Realtime_db.get value to PROVE it shows the text [object Object].
What can be the issue?
@emilio1 I would strongly urge you to use cloud variables rather than the Realtime DB if possible. It makes the blocks much simpler and easier to understand. I’ve made a fairly simple example app here which shows how you can use cloud variables with dynamic names (think of the names as the tags that you are using above), which I think you need for your example.
Also, are you really sure that you need to explicitly parse the JSON as you are doing in in your ‘taglist’ function? Things would be much simpler if you could just store and retrieve objects and use the ‘property’ blocks with them.
-Mark
Hi Mark,
I was troubleshooting that’s why i gave direct values to realtime_DB but in a real world scenario the children’s are user generated. That’s why i thought i can use the taglist function but by troubleshooting it looks that something isn’t right. Basically i want that each time button is clicked to return me a list with all children’s of that parent.
Thank you
@emilio1, if you look at the project that I linked to in my previous reply, you’ll see that I’m using cloud variables with user generated content (i.e., from a Text Input component).
-Mark
@Mark but they can add in number too that’s why i need to get all the childrens of a parent as a list when i click a button. The content is user generated that means that the parent can have 4 childrens now and after 30 min 20 childrens. The idea of the taglist function works as a logic but i dont know why i cant make it work in my project.
@User81
Hi,
Did you manage to solve your problem? If not, then I can think about it, if you give a textual structure of the data and what you need to get from it and in what form.
Hi @actech,
The taglist function is supposed to do the work but for some reason isn’t working.
The steps are like this:
Press button
get parent from realtime_db
get childrens from that parent and put them in a list
access the variable of the children with realtime_db.get() and location parent/Child_from_list
do something with that variable
Note that childrens can add and remove in number. One time they will be for example 4 childrens and next time 10. We need to get what parent have inside each time that we press the button. And then put the childrens in a list.
I hope i was clear
Thank you
Clear. Can you give me a link to your project? Without this, it is very difficult to understand the problem. Or I need a file with JSON data so that I can download it from my database and work with the data.
From FireBase, you can export data to a JSON file. I need this data for work.
Hi @actech,
{
“updatedList” : {
“asduhwibe8ifbiw3ibfss” : “I just came here update me to the list”,
“ihadiubew9r7g3rdf8egffa” : “Also information”,
“ohe92uh2dnqn9hu2q8fgre9d” : “Other user information”,
“ondaihudiwnd9he329h23rir” : “information”
}
}
This will be the json file. Did you understood clearly what i want to archive?
In the example below, child elements are added to the list and the child’s value is displayed when a list item is selected. What else needs to be done?
https://x.thunkable.com/projects/5bfd8f360834366be5f21dbc/project/properties/designer/
Thank you! This was enough
P.S. Nice website. I’m reading your last article with google translate
Thank you for your feedback about my site. Hope google translator translates the information clearly.