Hello, I’m have a form on my website that create leads im my CRM system (MyBusiness - based on Simbla framework).
I am sending various data which is received well on the other side and creates the lead perfectly. the only thing I can’t get through is the date value from the wix date picker.
I’ve tried to send the value, the ISO string of the value, different date formatting. nothing seems to work - I either get an error " “schema mismatch for Accounts.IDIssueDate; expected Date but got String” or the CRM returns success and creates the lead but leaves the date field empty
Some more details:
The field in the lead form/DB is of type DATE
Here is the code I’m using to send the data (from the corvid backend):
export function postToMB(formFields) {
const url = "https://apps.simbla.com/parse/functions/run_function?functionName=getlead";
const headers = {
'Content-Type': "application/json",
'X-Parse-Application-Id': MY-APP-ID,
'X-Parse-Master-Key': MY-APP-MASTER-KEY
};
const data = JSON.stringify({
"Name": formFields.fullName, //text
"PhoneNumber": formFields.phoneNo, //number
"City": formFields.residance, //text
"Age": formFields.age, //number
"IDNum": formFields.IDNum, //number
"IDIssueDate": formFields.IDIssueDate, //date picker - here lies my problem
//formFields.IDIssueDate is sent from FE as date.value (which is a string)
"PassportIssued": formFields.passport, //bool
"outAbroad": formFields.abroad, /bool
"Email": formFields.email, //text
})
const request = {
"method": 'post',
"headers": headers,
"body": data
};
console.log("ADDING LEAD @@@@@@@@@@@@@@@@@@@@@")
return fetch(url, request)
.then(response => console.log(response.json()))
}
I’m quite rusty so it maybe a very very basic error.
Thanks in advamce