I am creating a feature where users can request a size to be restocked. I have created a database where the information they enter (email address and size) goes to and I am wanting to link the current product page they are on to automatically go into the database as well. I have created a ‘reference field’ in my database for this referencing the store products but i’m not sure what code to put on my product page to make this happen.
I have tried this code but it doesn’t seem to work.
export async function submit_click(event) {
let productinfo = {‘product_name’ : product._id}
await wixData.insert(“requestSize”, productinfo)
}