I get a list and then I loop through each item of the list. The item(j) contails the email and role in the following format: email/role. I can’t seem to find a way to extract the email from j so i can compare for equality and get the role as well so i can return it. The snippet shows how far i have come:
I have the following block. I don’t understand what I did wrong that causes the function return value to be undefined.
You need to provide an example of the data you’re using. Without that, we have no way of knowing if your blocks are correct.
I ask the user for the email and roles when they sign up. Afterwhich, i concatinate them with a slash in between using the join. It works as expected until here. Later on, I go into adding the concatinated string to the list which doesn’t work. I will attach the block where i did those operations. Thank you for your help.
Okay, I was hoping for a visual but since you didn’t provide that I’m going to assume that you mean the date looks something like this:
bob@gmail.com/teacher
mary@gmail.com/doctor
angela@gmail.com/firefighter
Why are you storing them that way? It would be better to store them in separate keys in Firebase.
But if you must do it that way, those parsing blocks are going to provide a result. You’re storing those results in variables. What happens when you display them in labels? I wonder if you’re going to get “bob@gmail.com/” instead of what you’re expecting which is “bob@gmail.com”.