# Count object properties

**URL:** https://community.thunkable.com/t/count-object-properties/76261
**Category:** Questions about Thunkable X
**Tags:** firebase
**Created:** [May 14, 2019, 2:57am UTC](https://community.thunkable.com/t/count-object-properties/76261 "2019-05-14T02:57:02Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Javier\_Aquique](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@Javier\_Aquique](https://community.thunkable.com/u/Javier_Aquique)
#### Post date: [May 14, 2019, 2:57am UTC](https://community.thunkable.com/t/count-object-properties/76261/1 "2019-05-14T02:57:02Z")

</div>

In my Firebase Realtime Database I have a key with properties named 0, 1, 2…and so. Could I count the properties in this key in order to add a new one and name it after the sequence. For example if the last property is 4 the new one would be 5.

I can retrieve the object in a JSON format but them it show in the JSON format and i’m unable to count the properties or show all the record with the same property.

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [May 14, 2019, 7:07am UTC](https://community.thunkable.com/t/count-object-properties/76261/2 "2019-05-14T07:07:08Z")

</div>

Here you can go in two ways: create a structure in firebase as an array of objects with indices 0,1,2 … and then work with it as a list of objects or how do you use embedded objects, which can be converted to JSON string and manually get the necessary substrings using blocks for working with text and a list.

---

<div class="post-metadata">

### Author: ![Javier\_Aquique](https://avatars.discourse-cdn.com/v4/letter/j/34f0e0/32.png) [@Javier\_Aquique](https://community.thunkable.com/u/Javier_Aquique)
#### Post date: [May 14, 2019, 2:00pm UTC](https://community.thunkable.com/t/count-object-properties/76261/3 "2019-05-14T14:00:29Z")

</div>

I think you posted an example of that logic in another post, I’ll find it and give it a shot

---

<div class="post-metadata">

### Author: ![actech](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@actech](https://community.thunkable.com/u/actech)
#### Post date: [May 14, 2019, 6:53pm UTC](https://community.thunkable.com/t/count-object-properties/76261/4 "2019-05-14T18:53:16Z")

</div>

An example of manual work with JSON can be found on the scrJSON screen in the project:

[https://x.thunkable.com/projects/5cd84f23e3097f3353fdad45/project/properties/designer/](https://x.thunkable.com/projects/5cd84f23e3097f3353fdad45/project/properties/designer/)

---

<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, 12:13pm UTC](https://community.thunkable.com/t/count-object-properties/76261/5 "2024-11-08T12:13:45Z")

</div>


