How can I change the custom text field when adding to cart via code?

export function button1_click(event) {
    $w('#shoppingCartIcon2').addToCart("309ada05-7e44-a02f-028d-f049bb8e1b05", 1, {customTextField: "text"})
}

It doesn’t say any errors. It just doesn’t work.

Found the solution.

export function button1_click(event) {

$w('#shoppingCartIcon2').addToCart("ITEM ID", 1, {
 "customTextFields": [ {
 "title": "Name of the field",
 "value": "text you wanna have.."
 }]
 } )
 .then( () => {
    console.log("Product added");
 } )
 .catch( (error) => {
    console.log(error);
 } );
}