Unique ticket number per completed form in the notify me mail

The workaround with the date is possible using the Hidden field option.

Add the Hidden field to your form


Copy the ID of the Hidden field and add it to the Subject field in the Notify Me section

image


Adding the code to the Custom JS

Add the code below to the Custom JS section on the Settings tab:

function formatDateTime() {
    const now = new Date();
    
    const day = String(now.getDate()).padStart(2, '0');
    const month = String(now.getMonth() + 1).padStart(2, '0');
    const year = String(now.getFullYear()).slice(-2);
    const minutes = String(now.getMinutes()).padStart(2, '0');
    const seconds = String(now.getSeconds()).padStart(2, '0');

    return `[${day}${month}${year}${minutes}${seconds}]`;
}

const date = formatDateTime();
widget.setFieldValue('[current-date]', date)

Replace current-date in the last line of the code with the actual ID of your Hidden field


Please check it out and let me know if you like the result :slightly_smiling_face:

1 Like