Ability to have every form submission automatically have a unique identifier number assigned to it
1 Like
Hi there and welcome to the Community, @Kaleb_Willey
We agree that it would be great to have this feature built in our widget, and we’ll try to think about it in the future.
As for now, here is the workaround you can use:
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