Function not returning list

Hi, I’m have the following simple code which is to grab a list from firebase and return to calling function. I’ve tried MANY permutations but not seems to work. Any ideas:

here’s the relevant firebase section:

image

Hi @levelupjamdownf3n1,

I think you should try to remove the If (condition) not error block since the error should return a error code (text) not the boolean . Then have a try again.

Like this? Still did not work.
image

Note I confirmed the list was read from the DB using the following code and that worked so it has to do with the function not returning the list to caller. Do do I fix this?
image

I am having a similar issue wlith functions returning list. I’ve created an app to demonstrate the issue.

There are a variety of work arounds that could be implemented. Returning a list seems like a pretty fundamental feature to support.

Or am I missing something?

Related thread Returning Objects/Lists from Functions - #7 by b.perkins

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


I’m afraid you’ve misidentified the source of the problem. The function returns a list, but the blocks for determining the length do not work correctly.

https://x.thunkable.com/projects/5f48a3dca2ec59809f9ef60a/project/properties/designer/

actech thanks for pointing out the ambiguity in my post. You are 100% correct that the issues is related to using the length block when returning a list from a function. Other list-related blocks appear to work correctly. Also the list length block appears to work correctly when supplied a list that is not the return value of a function (as demonstrated in the modified app long click events).

Your firebase structure suggest a list (aka array) of object. your directly addressing the “value” as an object won’t work. May need to use the “in list get #_” block before accessing the object. my 5 cents worth