[Solved] Count the number of Results and Display them

So I am trying to figure out how to Count the number of times HAVEIT = true and then display the count. So far I am not having much luck… Can anyone point me in the right direction?

2

1

To get the value of a node, you must correctly specify the full path to this node. You have an incomplete path. How to find out the full path? In the Firebase console, open the node you need and see the full path to it, which will appear in the line above the data area.

So I’ve got the right path to my node. Now how can I get the count of how many times the word TRUE appears?
1

See blocks for working with objects. They have a block to get a list of all the child nodes. Make a loop on this list and count the number of true values.

I’m not sure where I’m going wrong,
#1. 1
As I understand it, this should list my 3 results from my database.

2

However I am not getting any results when I test it…

I can’t even get them to display, nevermind trying to count them.

You need to use the “get object from JSON” block, and not the “generate JSON from object” block.

I feel like I’m so close tonight. I’m just missing something…
1

So far it is returning 0, I believe it should be returning 3…

Hi.
You have the solution in this video: https://www.youtube.com/watch?v=QmkuI7iomlU

You are using a block “generate JSON from object” for a list of objects. It is not right. “value” block already contains a list of objects, and it needs to be connected directly. Do you understand this?

%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5

for my data

%D0%B8%D0%B7%D0%BE%D0%B1%D1%80%D0%B0%D0%B6%D0%B5%D0%BD%D0%B8%D0%B5

1

I have changed my blocks as you have suggested, however my project returns nothing…

If I am doing something wrong, I cannot see it. My project is located here: https://x.thunkable.com/projects/5d80ea20d3cd04e640f715ca/318e17e8-4a59-4484-8d23-a0718927cd5a/designer

If I read your posts correctly then I believe that the value of the "HAVEIT" property will be the Logic value true or false, not the Text value "true" or "false".

Hope this helps.

-Mark

1 Like

You’re right. For this reason, before the block get property HAVEIT to insert a block join to convert a logical true in the string “true” to add it in ListViewer, and in block if instead of the block “true” use true block.

1 Like

Thank you very much guys. It worked. This thread is closed!

1 Like