Here I have code that trigger ref /tugas_course/{course_id}/{tugas_id} whenever child added will send notification to the android device. It already doing really well. But I want to add one more function inside it, I want to add child outside this ref called flag_tugas and will be populate with flag_tugas-course_id-tugas_id-user.uid: "o". I dont know how to add it, because the return value already take it all and how to get users id in cloud function.
export const onNotifTugas = functions.database.ref('/tugas_course/{course_id}/{tugas_id}') .onCreate((snapshot, context) =>{ const course_id = context.params.course_id; const tugas_id = context.params.tugas_id; console.log(`New Message ${course_id} in ${tugas_id}`); return admin.database().ref('/tugas/' + tugas_id +'/').once('value').then(snap => { const tugasData = snap.val(); const notifDataSend = { // buat structure data json dgn nama const notifDataSend untul cloud messaging data: { data_type: "tugas", title: "Anda mendapatkan notifikasi baru..", // data bebas (key, value) body: `Tugas ${tugasData.nama_tugas} baru`, // chatId = const chatId sound: "default" } }; console.log(`data yang dikirim `); return admin.messaging().sendToTopic(course_id, notifDataSend) .then(function(response) { console.log("Successfully sent message:", response); }) .catch(function(error) { console.log("Error sending message:", error); }); }).catch(error => { console.log(error); }) }); } Actually adding the new child under eclassapp 
Really thanks for your time and answer..