Copy product name from product page into database

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)
}

I also tried this code. However, I also have a wish list function on this page and it says ‘‘product’ is already declared in the upper scope’.

export function submit_click(event) {
$w(‘#productPage1’).getProduct()
.then( (product) => {
let productName = product.name;
wixData.insert(“requestSize”)
} )

}