Update Profile in Firebase Realtime database

Hi. I’m trying to update the specific user’s profile.
But others will have to stay with the same value if i didnt put any on textbox.

This is my blocks, can you tell me what’s wrong?
The firebase database was erasing my data if i leave the textbox empty.

You are saving email alone properly but other fields you are not saving properly. Pls check up properly… move the blocks into else block of each if condition.

4 conditions are there but for email alone you are using else, try to move the remaining thing just like what you designed for email.

If the name box is empty
Then save global name variable
Else save text box value.

Got my point???

u mean like this?

Do not use alert in all fields… just use it one time at desired part ( after all if then else) If not 4 times you will be seeing this alert


1 Like

I am not sure spinner selection is empty will be true… if so you must use first option as select one and try to match this. If the spinner selection is equal to select one , save global variable value else save selection value

Pls see to this point also

1 Like

oh that’s right. it didnt saved the spinner. let me try what you just said.

how can i do the select one ?

How do you add elements in spinner? Pls show

like this

I didn’t mean this, whenever screen open spinner will show first element…

So select item visible mean user or admin not choosen any… if they select any then selected value will become visible.

I hope you understand what I am trying to tell you

oh like this

Yes you got it… now rearrange the rule in blocks

If Spinner selection = Your Barangay (which mean no option choosen)
Then save global brgy variable value
Else save spinner selection value

okay, let me try it :heart_eyes:

its working now. thank you so much

1 Like

Glad to help you… always check up the work flow one by one… you will get answer yourself… if you able to develope coding then bug fixing also you can… :+1:

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