Date error: This value wasn't passed to the contact record. '1/6/2020' isn't a valid timestamp.
SOLVE
i'm working with the AJAX support to send forms, and when looking at the date field at one of the forms, at the form's submissions it says the title error (This value wasn't passed to the contact record...).
i looked into it and tried the offered solutions from previous posts:
this is the first version:
let nowDateTime = new Date().getTime();
i tried send the date after setting it to midnight, but it still got the error.
let nowDateTime = new Date().getTime();
nowDateTime = new Date().setHours(0,0,0,0);
i tried to look for the type to see what the type the form expect. didn't found it. so i don't know for sure if it's date or dateTime but, it's date picker so it's date based on the docs (i guess, still didn't understood how to know if it's dateTime).
what this sentence mean : "The only way to create a datetime property is by using the APIs"? link to the docs
anther thing is that the same code that create the field being sent, works for other forms.
i tried to compare the form property with other and didnt found anything different.
Could you share complete sample JSON you're submitting to the v3 forms endpoint? I'd like to see the value of your nowDateTime variable. Per this article, it should be a millisecond timestamp corresponding to midnight UTC if the property is a date-type property, which it sounds like.
Also if you could share your form GUID (for security, no need to share your Hub ID).
I confirmed that the dpsaddtravelerdetailsdate property is a date-type property in your account ending in 0425.
It expects a UNIX millisecond timestamp at midnight UTC/GMT, but 1578434400000 actually corresponds to 7 January 2020 at 22:00:00, not midnight (I used this tool).
the code creating the value ( a little different from the how i implemented it in the original post, because it was translated to yesterday midnight) :
const updateDate = new Date();
updateDate.setHours(24,0,0,0);
const nowDateTime = updateDate.getTime();
this is how i set it to midnight (a little different from how i posted in the original post, because after checking the submission, it was translated to yesterday midnight):
const updateDate = new Date();
updateDate.setHours(24,0,0,0);
const nowDateTime = updateDate.getTime();
the form GUID is: 6256018a-b178-45ed-b528-2c1ffb70d011