Strange change from string to boolean when going from mit app inventor to firebase and back

I have been searching for 2 days for a reason, but it is impossibel. I am uploading data from one vlock.

In the firebase the data looks like this
["Cilodex","3+1 mg/ml","øredråber","5 ml","10","Rønne Apotek","''''''''''''@gmail.com","02-06-2023 15:58:11 ","true"]

And is used in the map afterwards

However the marker fill color do not work and the color does not change. Second it is really strange how the string "true" goes to firebase as "true", but is read on the return as a bolean true. Any suggestions to help me.

It is how the AI2 firebase component works, because you have the data in a list. When the list is returned and you extract the boolean, there are no quotes, therefore AI2 sees it as a boolean and not a string.

What about the color change of the marker?

I suggest you simplify what you are doing.

Start with just changing the colour of the marker, then build your list selection bit by bit.

But it is very simple I see label 4 fire and hereby should marker 1 also change colour to green, but nothing happens. Look at the marker fill colour function.

Then you should be able to make it work...

You have five or six variables, lists, an "interesting" clock procedure, you do not provide any detail/data for these in your enquiry. How are we supposed to know?

As suggested, break it down, do each part separately until the whole works together.

1 Like

sorry i will try and simplify.

I suspekt there is a problem with firebase in procedures. I have used it without problems, but this time even simple if the blocks seized working. The attached transfer to procedure is not working, but outside the procedure it works fine. I dont see any reason for this in the coding. Do you?
Dont mind the marker 2 function.




unbelievable you have nearly 19 global variable with almost same name. Please give them a meaningful name.

If you really need that much variable? what about use a list or Dictionary ?

I dont think you have been following my project. I ahve a database with thousends of combinations. The numbered variables are to keep track of them. And compared to the database the variables are kept low. A dictionary is a small database as far as i now. Lists are used ekstensively.

hmmm, I suggested that you simplify, yet you come back with something even more complicated!

debug a (partial) project with variable name like name2, name3, ..., name19 making me headache.

Sorry I just quit.

2 Likes

ok very simple one. What is wrong with turning the simple blok into at procedure. It will not do the task of changing the color of the marker. The one you call complex earlier is the same problem just a smaller block.
blocks (39)


Is "global name19" a list ?
What is the structure of that list ?
Is index 9 of the list global name19 either true or false or something else ?
Have you tested the condition select list item global name19, index 9 = true/false/something else?

global 19 is a list from firebase.

["Cilodex","3+1 mg/ml","øredråber","5 ml","10","Rønne Apotek","j************@gmail.com","03-06-2023 09:38:02 ","false"]

It is true,false and nothing. The block works fine when not in the procedure. I am not sure what you mean with another condition. The block need to change the colour and this doesnot happen no matter which colour or line. I understand you that you suggest i change the whole block to make a working procedure.

Have you tested this

image

Hmmm, I believe you may need to use the component block and anymarker block to make this work

yes this one does not work either.


blocks (40)

Try like this

image

i have tried most things but i cant find the set marker fill colour of component function. Where can i find it?