Change picture from data in firebase

hello , can i ask about code block in kodular, how to change picture when get data string from firebase? thanks

If you show your firebase structure, relevant part alone, it could be easy for us to guide you also show us what have you tried.

Else use
When firebase got value,
set picture to get values

i mean , i have to condition, 1 and 0, if firebase send data 1 picture change to bird, but if data 0 picture change to chicken

then you should use when firebase data changed block…

1 Like

would you like to show it?

i have did like this and got response nicely… i use to put 1 or 2. but you can change any rule



1 Like

thank you, i will try it

how to know condition 1 and 2, where do i put the condition

Haven’t you stored condition in firebase ?

how many images do you have? if only two images, then


but if you give any other number apart from 1 and 2 it will not change as i have only two image links only in my variable

If you using else block and accidentally gives anyother number apart from 1 and 2 it will show you an error in app

1 Like

my code program, use 3 sensor, dht22, mq2 and flame sensor

do not use url. instead use project bucket and try

IF the above didnot work, pls try this method… actually, firebase data changed mean, automatically it will read those bucket. so you need to add anyother blocks…

I am strongly recommending you to use this block…

why, can you explain why it’s better to use project bucket? im newbie

thank you so much, its worked perfectly, thank you so much

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