Error "is in list?" with a list as an argument

Hi, I'm working with this realtime-database in Firebase:

image

So I want to know if an user is in the list "Jugadores_inscritos", but when I call the "is in list?" procedure it fails

I hope you can help me, Thanks!

Jugadores_inscritos is an empty list as shwon in firebase structure. Also note that when tag list contains only integers like 1, 2, 3… Get tag list block will not work properly so use tags in the form of 01,02,03....or A1,A2,...etc

Thanks for replying! I didn't understand why having an empty list is getting a error, why didn't return false?

About the 1, 2, 3 tags, I was looking at the JSON file and, for some reason, Equipos is saving the data inside a list, instead of a dictionary, can it be because what you said?

image

Edit: Now I'm saving the ID as A0000, A0001, etc. and this changed to a dictionary of dictionaries, but still returning something else instead of a list for "Jugadores_inscritos"

I checked if empty lists can be stored and queried directly in Firebasedb, and it worked for me.
However, that leaves the question of how you built the dictionary in that element of list Equipos.
Capture data firebasedb_courses.aia (2.1 KB)

This is how I built it

Saving an empty list:

How it looks in Firebase:
image
image

How I'm retrieving the data from Firebase:
image

Returning something else:
image

It seems that I'm saving a string instead of a list when I'm retrieving the data, since this procedure is returning a double quote string

image

And the APP shows the quotes

Hi, I'm working with Firebase but when I try to retrieve the data I get double quote strings instead of a string and a string instead of a list

This is how I built it

Saving an empty list:

How it looks in Firebase:
image
image

How I'm retrieving the data from Firebase:
image

Return:


image
image

How important is your existing database structure? If all the work being done is "in the app", then it would make sense to save entire records as a list in a single tag. The you don't have to mess around with dictionaries and parsing anything like what you are doing at the moment.

You can always do some manipulation of your returned strings:

blocks (4)

procedures_callreturn

Thanks for replying. I did that but even now when I'm saving it right it's returning a string when trying to get a list

Retrieving the data:

Getting the data:

RIGHT:
image

WRONG:

See here, perhaps this will help you out of your chaos....

After reading it I realized that when you try .getValue to a ProjectBucket you get a string of the structure and not the structure itself (as I tought), so you must to clean all the quotes and "".

I will start from scratch and catch just the data from the selected item, since your example is much better. Thank you very much!

image


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