Wix Automation doesn't send notification after data insert

hi,

I have custom forms on the site and I created trigger with wix automation. I wanted to get notification after form submission by email but I did not get any e mail. I am using the code below…

export function buttonReservation_click(event) {
  
        toInsert.tourName = $w("#input1").value;
        toInsert.fullName = $w("#inputFullname").value;
        toInsert.tourDate = $w("#reservationDatepicker").value;
        toInsert.adults = $w("#dropdownAdults").value;
        toInsert.child711 = $w("#dropdownChild711").value;
        toInsert.child36 = $w("#dropdownChild36").value;
        toInsert.infant = $w("#dropdownInfant").value;
        toInsert.email = $w("#inputEmail").value;
        toInsert.phoneNumber = $w("#inputPhonenumber").value;
        toInsert.notes = $w("#textBoxreservation").value;
        toInsert.total = $w("#text122").text;
 
 //etc...
        wixData.insert("Reservations", toInsert)
        .then(() => {/*show message*/})
    }

If I use submit button function it works fine but there is text (#text122 ) which is total of reservation amount in my form and I want it to save in dataset after form submission and the text field doesn’t save it…

Do you think is it a bug? Do you have any idea to fix this issue?

That´s 2 questions, right?
1: no email
2: no Save

Lets start at the beginning (Save, for you cannot email something if it has not been saved): what is the field type of " total" in Reservations? If Number, you need to convert the string (.text) to a numeric value (parseInt, parseFloat) first.

Hi Giri Zano,

The field type of the total in Reservation is Text and it works fine and also I have dynamic input which name of the product it is also saved in dataset there is no problem for saving with the code I used. I am getting all field that I need from the submit form but I don’t get email from the wix automation when someone submit the form. Because I have used the insert code that I mentioned above…

Instead of using a code I can set the button with submit function without code, in this case I am getting e mail after the submission but it doesn’t save 2 field which are below;

1 - Input 1 - dynamic input ( type of the field is text in dataset )

2 - text122 - total of reservation ( type of the field is text in dataset)

maybe i couldn’t explain it well here is sample you can a have look;

https://aqrep55.wixsite.com/website-2/daytrips/Bursa-Day-Trip-from-Istanbul

Thank you so much for your support.

Ah, I get it, text122 is a calculated field. You will have to use setFieldValue() to put that value into the array before you save https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#setFieldValue