I am not able to get the email list data from firebase. All it shows is "null".
Although the variable agent0 shows the correct selected data from the array, I can't seem to use it with the firebase reference.
How can I use one of the array values to get data from firebase?
var agent0 = agents[0];
window.alert(agent0);
var refPullEmail = firebase.database().ref("Forwarder Contact").child("All Origins").child(agent0);
refPullEmail.once("value")
.then(function(snapshot) {
var agentEmail_0 = snapshot.child("EmailList").val(); //return list emails
window.alert(agentEmail_0);
});
Database :
