I have a reference field in my database for user's email and I'm trying to connect it with the members database so I can use the user's data. I connected it form the database but when I try to insert the email value in the referenced field it always shows broken reference. I've read a lot of answers on the forum but nothing seems to work. I first added the email without any editing then I tried to convert it to a string but neither worked.
let newUser = {
"title": $w('#title').value.trim(),
"image": image,
"host": email.toString() // this is the referenced field
}
wixData.insert("users", newUser)
.then((results) => {
console.log(results)
})
.then(emailData => console.log(emailData))
.catch(err => console.log(err))
// console.log(results)
})
.catch((err) => console.log(err));
@Yisrael (Wix) can you help me? I have similar problem
@Yisrael (Wix) Can you please help me with that?
I did not use this documentation, but all the previous uses so far in a simple reference field I belonged to the ID field
Suggest you try anyway
You should send the ID