# \[SOLVED\] Problem getting object proprety from firebase json string

**URL:** https://community.thunkable.com/t/solved-problem-getting-object-proprety-from-firebase-json-string/456885
**Category:** Questions about Thunkable X
**Tags:** firebase, beginner
**Created:** [February 10, 2020, 9:07pm UTC](https://community.thunkable.com/t/solved-problem-getting-object-proprety-from-firebase-json-string/456885 "2020-02-10T21:07:08Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![habib2891100p4v](https://avatars.discourse-cdn.com/v4/letter/h/9de0a6/32.png) [@habib2891100p4v](https://community.thunkable.com/u/habib2891100p4v)
#### Post date: [February 10, 2020, 9:07pm UTC](https://community.thunkable.com/t/solved-problem-getting-object-proprety-from-firebase-json-string/456885/1 "2020-02-10T21:07:08Z")

</div>

So first of all, Hello and thanks in advance.  
I am setting up a database listener to update the local database if any changes were made.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/9/699a9b2083180279b0e8438ad9f40e8aeaaeb69d.jpeg)  
This block is my try to fetch the nodes and child names it works until the last string : “AT”:“text”,“Conclusion”:“text”  
i am trying to get the object from the json string and it’s property “AT” but to no avail the app just stops and no result is given

---

<div class="post-metadata">

### Author: ![Mark](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mark/32/18133_2.png) [@Mark](https://community.thunkable.com/u/Mark)
#### Post date: [February 11, 2020, 12:30am UTC](https://community.thunkable.com/t/solved-problem-getting-object-proprety-from-firebase-json-string/456885/2 "2020-02-11T00:30:21Z")

</div>

Instead of generating JSON from the object returned by the Firebase DB and then parsing that JSON, I would suggest directly accessing the data that you need from the object returned by the Firebase DB. That should greatly simplify your app.

[Our documentation on objects and JSON](https://docs.thunkable.com/objects) is a bit slim (but worth reading). We also have some tutorials that might help [here](http://community.thunkable.com/search?q=json%20%23thunkable-cross-tutorials%20order%3Alatest). It might also be worth reading up a little on JSON, if that’s what is the issue here. Perhaps one of our community members could point you to a good introduction.

I’ll also point out that you can use [Cloud variables](https://docs.thunkable.com/variables) rather than the `Realtime DB` component to access the Firebase Realtime DB and get notified when a key changes. That might also simplify things for you.

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [February 11, 2020, 1:13am UTC](https://community.thunkable.com/t/solved-problem-getting-object-proprety-from-firebase-json-string/456885/3 "2020-02-11T01:13:12Z")

</div>

@Mark, I really like the cloud variables, but they share info between all apps. I wish the variables could be instantiated with a username so that info in the cloud variables could be private.

For this reason, directly using the DB is better. Data security. The cloud variables are nice for personal apps or apps with limited distribution. Perhaps for a high score board or something. Like if I want to share a reminder app between me and my wife. On the other hand, to create a key for the real time data base, it is as simple as using a text log in to save user name. This allows users to store and recall information in private. This way Dad I will be stored under garage users email address which will be unique to the user

---

<div class="post-metadata">

### Author: ![habib2891100p4v](https://avatars.discourse-cdn.com/v4/letter/h/9de0a6/32.png) [@habib2891100p4v](https://community.thunkable.com/u/habib2891100p4v)
#### Post date: [February 11, 2020, 11:13am UTC](https://community.thunkable.com/t/solved-problem-getting-object-proprety-from-firebase-json-string/456885/4 "2020-02-11T11:13:27Z")

</div>

Thank you both for the response.  
I would rather work with realtime db than cloud mainly for the same reason explained by @jared (also because i have no idea how).  
@Mark As for your proposition to access data directly do you mean from the object like this

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/c/bcf15d27ddd0ab0f63bda1a39eca94afeca4713b.jpeg)  
or get data as list and compare it to local database to get the changes?

---

<div class="post-metadata">

### Author: ![Mark](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mark/32/18133_2.png) [@Mark](https://community.thunkable.com/u/Mark)
#### Post date: [February 11, 2020, 7:19pm UTC](https://community.thunkable.com/t/solved-problem-getting-object-proprety-from-firebase-json-string/456885/5 "2020-02-11T19:19:44Z")

</div>

> [@jared](#):
>
> I really like the cloud variables, but they share info between all apps. I wish the variables could be instantiated with a username so that info in the cloud variables could be private.

@jared Can you give some more details about this? The implementation of Cloud variables is intended to provide the same support for security and privacy as for the Realtime DB component. If that is not the case we’d certainly like to know about it, especially if you could provide a specific example app that demonstrates it.

---

<div class="post-metadata">

### Author: ![Mark](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/mark/32/18133_2.png) [@Mark](https://community.thunkable.com/u/Mark)
#### Post date: [February 11, 2020, 7:21pm UTC](https://community.thunkable.com/t/solved-problem-getting-object-proprety-from-firebase-json-string/456885/6 "2020-02-11T19:21:09Z")

</div>

> [@habib2891100p4v](#):
>
> As for your proposition to access data directly do you mean from the object like this …

Yes, that’s the sort of thing that I meant.

-Mark

---

<div class="post-metadata">

### Author: ![jared](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/jared/32/138473_2.png) [@jared](https://community.thunkable.com/u/jared)
#### Post date: [February 11, 2020, 8:52pm UTC](https://community.thunkable.com/t/solved-problem-getting-object-proprety-from-firebase-json-string/456885/7 "2020-02-11T20:52:35Z")

</div>

Of course! And to be more precise, i do mean shares info across distributions. Not apps I am creating. What i would like to use firebase DB for, is parents i work with who use my data collection app. I would love to be able for each others app to update in realtime as the other parent makes a change. I want this to occur based on signing in with the same email address/username on a different device. so in essence, if parent 1 makes a mark, parent 2 will see it because they share a realtimeDB key that looks like /username/data/

right now with clouds, you cant include the username in the cloud variable name. If i can’t specify whose variable it is, how can i keep these all separated by user.

here is a very basic example. Maybe you can fill me in on how to make these private but across devices that i install this on, the same variable will show on this screen. “screen 2”

[https://x.thunkable.com/copy/365e6eb8dc2e42d09fdd97bddcca1579](https://x.thunkable.com/copy/365e6eb8dc2e42d09fdd97bddcca1579)

 ![Screen Shot 2020-02-11 at 3.37.53 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/3/03b6851bd87dabd76b5e6ec65815ebbab6d15a8e.png)  
you should see the value @Mark when you open the app and click the button.

Is there a way to make the cloud variable specific to a user?

I would love to be able to set the username as part of the variable. Or if there is a firebase login being used, that whoever is logged into the app, that their login info is associated with any cloud variable in the app if the developer wanted.

on the other hand, this works for my needs but can be complicated to use sometimes ![Screen Shot 2020-02-11 at 3.51.45 PM](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/b/0/b03cee0ece50348a3cf5a3d81cc6efa12921bbf9.png)

---

<div class="post-metadata">

### Author: ![ioannis](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/ioannis/32/146956_2.png) [@ioannis](https://community.thunkable.com/u/ioannis)
#### Post date: [November 8, 2024, 11:41am UTC](https://community.thunkable.com/t/solved-problem-getting-object-proprety-from-firebase-json-string/456885/8 "2024-11-08T11:41:03Z")

</div>


