Firebase Variable

I have a Firebase variable which is actually a sentence:

afbeelding

I want to retrieve it and change a label to the value of that variable using the following blocks:

Unfortunately it only retrieves the first word of the value:

afbeelding

I checked if it was retrieved as a list by using the following blocks:

afbeelding

but the outcome is “not a list”:

afbeelding

What am I doing wrong?

1 Like

a sentence is not a list. a list have min 2 items. A item can be a intenger or a string or a commbination of both.
You need a second ite in the tag to have a list.

Okay, I used the wrong item names. So the variable I want to retrieve is a string, but it only retrieves the first word of the string.

How do I retrieve the complete string “This is a test” in stead of only the first word “This”?

why not use if not is list empty or anything other.

Thank you for helping me but to clarify: the list is not the issue. I only want the entire value of the Firebase variable. Forget about the list example, it was just to make sure it was not retrieved as a list.

1 Like

No proble mark it as solved if it is solved.
And you have only to set the label to the value not more and you should get the whole text.
If tag = Test Vvalue
than do set label to value and you get the whole text if the tag is Test Value. If you use other words for you tag change it to the tag which you have used.

That is just it: I only get the first word not the whole text. You did not understand my question as you thought it was a list thing.

It is not solved.

afbeelding

The variable Test_Value is “This is a test”. The blocks above only gets the word “This” and not the complete string. It stops retrieving at the first whitespace.

If I store the value as “This-is-a-test”, it retrieves the complete string as it sees it as one word.

than try to load the alue in a global variable and than set the variable into the label. Maybe this helps,

If not than save the string with __ or - and if you get the alue back replace the _ or - with nothing use for that the pink block replace text segement with …

image

As i told if it works only with - or _ than sae it with that and if you get the alue set this block into the label and replace the _or - with a space or whatelse

image
Here you can see how and you change the collintree elemet with the value.
Set label text to than take that block and you hae what you want.

Using a global variable does not change anything so I will have to try the replace function. I do think this is a way around and not really a solution but I guess it will do.

Will try it out this evening.

This is a way that i told you better as nothing or. If it works click on solved. Thank you

Try oe more thing

When you write the value put it in quotatios marks

Join ", value, "

and write that. See if that works.

Try setting the label text to “select item list=value index=1”. It should work.

To explain, this is because every single firebase value is a JSON, and the whole database is a superset JSON. As someone who uses Firebase extensively, I do believe it’ll solve the problem.

Unfortunately no, it does not solve it: “Bad arguments to select list item”.

Strange. It works for my use case…

This is very annoying but alas. I will have to use the obvious workaround and replace whitespace with a character and replace it after retrieving (also suggested by plang58). It is not the solution to my problem or an explanation why it happens so I will not yet mark it as being solved.

1 Like

Did this not work?

Hmm, could you tell me why I should use the function join?

So you can force quotations marks into it, so that Firebase sees it as a complete string, and not perceive the spaces as a break and therefore creating a list.

I am just guessing here.