Firebase _ScopeVariableInfo cloud variable error notification

Hi i was trying to store a list to firebase using the blocks below. If i use the cloud variable, it stores fine in the firebase (see last image), but i also want to detect any error so i prefer to use the realtime blocks.

However, when i use the realtime blocks (See 2nd image), automatically an item _scopevariableinfo gets added to the list and block further actions to the list (see 1st image)…not sure why…

Hi,

Lock the list is due to incorrect index. Your structure root ClansList is an array of objects. And to access the array elements using numeric indices. But in the second image instead of a number index you add the text in root ClansList. Therefore, block further actions to the list.

Sorry i don’t fully get you.
i understand app ClansList is a list. I’m adding the list as a value to the key ClansList in Firebase, is that not allowed? But if so, why is the third image ok because i seem to be doing the same thing just using cloud variable instead.

But thank you for your response!

@Zhou_Sicong, You have hit upon a bug in Thunkable, whereby ordinary list operations do not work on lists that are obtained from the Realtime DB component. Until it is fixed, I will suggest a workaround. The basic idea of the workaround is to copy the list that you obtain from the Realtime DB component. Unfortunately, you can’t use most of the normal list operations to do do that, for example, the length of block. So, what you’ll need to do is to save the length of the list the Realtime DB component along with the list itself and use that length to copy the list after you retrieve it from the Realtime DB component. Then you can use that copy with ordinary list operations.

As an example, here is a very simple example project that uses the technique suggested above: https://x.thunkable.com/copy/45b59e92e03130294e2173a567eeb9bc

And here is a screenshot of the blocks in that project:

I hope this helps.

-Mark

1 Like

I’ve had issues with lists while using cloud variables and realtime db.

What I have done is store the list as text on the cloud var/realtime db and convert it back and forth with the make list from text and make text from list blocks.

3 Likes

I think the problem may also lies with using an If block within the realtime db get block.

I was able to execute all the lines of codes correctly if i pull them out of the if block separately.
image

I also check that the if condition return a true separately.

Yet when i put the above two together, they don’t execute.

1 Like

The problem associated with the use of global variables. Suppose we have a numeric list of three items 1,2,3

If the list is stored in the variable function, the list of preservation takes place when it is stored in Firebase

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

, and upon receipt we will see:

[1,2,3] - this is the list. That is, a list of saved correctly

If the list is stored in a global variable, then when you save it in the happens Firebase object preservation:

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

For get a list, you can use these blocks:

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

3 Likes

O awesome, i think it will solve my problem! Thanks so much!

1 Like

Ah yes, @actech, that’s an even better approach than mine! I would just suggest putting the blocks in the 'then do' into a function, so it could be used in other places (i.e. with other 'RealtimeDB call Get' blocks).

-Mark

1 Like