Recursive function to look up multiple occurrences of data in a Firebase/JSON structure

W-O-W-W-W-W-W :open_mouth:

YOU ARE AMAZING!!! You did it! :nerd_face:

Thank you very much my friend! For me this is really a depper level of programming (forget the NO-CODE here :blush:)

And just to put my 2 cents in this discussion, following the updated version of your project that add the full path of the object (as I need to show in my project):

https://x.thunkable.com/copy/f2e9446a2efbe77aa0c74902cb70e1d5

The final result is exactly my comment above:

Again: THANK YOU VERY MUCH!

With my best regards,

Paulo Vaz

[UPDATE 1] - A small fix in the project, to show the path correctly, link changed!

1 Like

totally agree! thank you, @muneer !

1 Like

if you add path as a parameter to searchName and update it as you recurse, you don’t have to worry about trimming the last node off the path when you pop out of recursion at any level - it will take care of itself.

3 Likes

i see what you did there! (using object properties and testing for ‘[object Object]’! CLEVER!)

1 Like

Yes! See my (bad) example above…

This is a simple trick to discover if the object is a bucket or a simple value (no nested objects below)… This was something I discovered empirically testing when showing in the screen the results of a cloud variable. And it works!

For sure @muneer knows this very well :slight_smile:

That’s are the things we need learn to reach the next level in APP development, and just because this community help, I’m moving forward with Thunkable. :heart:

Thanks to you too!

2 Likes

Thank you @paulovaz72

Thank you @manyone

I was trying to find a replacement of JavaScript typeof property.

I started to convert the object to JSON and count the number of colons in the JSON. Only a terminal node will contain a single colon, other nodes (buckets) will always have more than one colon.

1 Like

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