I tried like that but it does not work too!
Gravity Form to Leads please?
Collapse
X
-
I did but it still does not work. I still need to fill in the date field in the Gravity form if I want the form to be captured. Otherwise, nothing captured!Nth20,
Yes, you can try this way. Change the settings in Gravity Forms, and leave everything as is in EspoCRM.Comment
-
I contacted the Gravity Form staff and they informed the following error and asked me to contact you to find out how to prevent your API returning the 400 error:
2025-07-31 11:51:56.211333 - DEBUG --> GF_Webhooks:
rocess_feed(): Sending webhook request to (My lead capture link); Array
(
[body] => {"firstName":"Hanh","lastName":"Nguyen","cNoOfG ues ts":"5","emailAddress":"testtesttest@gmail.com","addressCountry":"Viet Nam","cPhoneNumber":"09999999999988","cDepartureT r ain":"","cDepartureTickets":"","cDepartureAdditio n alServices":"","cDeparturePoint":"","cDepartureAdd itionalNotes":"","cReturnTrain":"","cReturnTickets ":"","cDepartureDate":"","cReturnDate":""}
[method] => POST
[headers] => Array
(
[Content-Type] => application/json
[Accept] => application/json
)
[sslverify] => 1
)
2025-07-31 11:51:56.269546 - DEBUG --> GF_Webhooks:
rocess_feed(): Webhook sent. Response code: 400; body: {"messageTranslation":{"label":"validationFailu re" ,"scope":null,"data":{"field":"cDepartureDate", "ty pe":"valid"}}}
Last edited by Nth20; 07-31-2025, 01:29 PM.Comment
-
Thanks Iazovic, because I use the form for travel booking for both one-way and round-trip tickets with departure date and return date so someone can book one-way tickets only (they will fill in the departure date and leave the return date empty). That's the reason why sometimes the date field will be empty if my clients book one-way tickets only. How to tell the EspoCRM not to send that field when it's empty please? Is there anyway to set it in the workflow? I really need your help please.Nth20,
The 400 error is caused by EspoCRM not accepting an empty string for the Date type field. To fix it, don't send that field when it’s empty, or send a default valid date like "2025-01-01".Comment
-
Nth20,
Create a Varchar field (in the provided example, it's called "newField") and insert the following formula script in the Administration > Entity Manager > Meeting > Formula:
In the Gravity Forms, use the "newField" for date data transferring.Code:if (newField) { cDepartureDate = newField }Comment
-
Thanks Iazovic, in my Gravity form, there are 2 date fields. One date field called Date from Hanoi (cdepartureDate in EspoCRM) and other date field called Date from Sapa (creturnDate in EspoCRM) so will I need to make 2 formula scripts as belows?
Is this code correct please?Code:if Date from Hanoi { cDepartureDate = Date from Hanoi } if Date from Sapa { creturnDate = Date from Sapa }
Thanks in advance for your help!Comment
-
Nth20,
In EspoCRM you need to create two more fields, for example, departureDate1 and returnDate1. In Grafity Form, you need to map the values of Date from Hanoi and Date from Sapa to these fields. Then in EspoCRM use the following formula script:
Code:if (departureDate1) { cDepartureDate = departureDate1 } if (returnDate1) { creturnDate = returnDate1 }Comment
-
Thank you so much Iazovic, it worked and I really appreciate your time and help!Nth20,
In EspoCRM you need to create two more fields, for example, departureDate1 and returnDate1. In Grafity Form, you need to map the values of Date from Hanoi and Date from Sapa to these fields. Then in EspoCRM use the following formula script:
Code:if (departureDate1) { cDepartureDate = departureDate1 } if (returnDate1) { creturnDate = returnDate1 }👍 1Comment
-
Hello Iazovic, the problem now is that we cannot edit the Departure / Return date please. Whenever we edit it, it was saved then return the original date. I think the Departure / Return date were taken from the field departureDate1 and returnDate1 so if we want to change the dates, we should need to change these date fields, not the Departure Date and Return date fields shown in the front. Can you please help?Comment

Comment