Gravity Form to Leads please?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nth20
    Member
    • Jun 2025
    • 30

    #16
    I tried like that but it does not work too!

    Comment

    • lazovic
      Super Moderator
      • Jan 2022
      • 1132

      #17
      Nth20,

      Yes, you can try this way. Change the settings in Gravity Forms, and leave everything as is in EspoCRM.

      Comment

      • Nth20
        Member
        • Jun 2025
        • 30

        #18
        Originally posted by lazovic
        Nth20,

        Yes, you can try this way. Change the settings in Gravity Forms, and leave everything as is in EspoCRM.
        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!

        Comment

        • Nth20
          Member
          • Jun 2025
          • 30

          #19
          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; Yesterday, 01:29 PM.

          Comment

          • Nth20
            Member
            • Jun 2025
            • 30

            #20
            Can anyone help me please?

            Comment

            • Nth20
              Member
              • Jun 2025
              • 30

              #21
              Can anyone help me please?

              Comment

              • lazovic
                Super Moderator
                • Jan 2022
                • 1132

                #22
                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
                  Member
                  • Jun 2025
                  • 30

                  #23
                  Originally posted by lazovic
                  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".
                  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.

                  Comment

                  • lazovic
                    Super Moderator
                    • Jan 2022
                    • 1132

                    #24
                    Nth20,

                    As a workaround, you can create a text or varchar field for the date, send date data there, and if the field is not empty, then transfer the date to the desired field (cDepartureDate) specifically for the date.

                    Comment

                    • Nth20
                      Member
                      • Jun 2025
                      • 30

                      #25
                      Can you help me with the detailed workflow to do that? I also thoutht about using a text or varchar field to capture the date but will it affect how it act in the EspoCRM when the date field is not the date field? Like sortable or filter...?

                      Comment

                      • lazovic
                        Super Moderator
                        • Jan 2022
                        • 1132

                        #26
                        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:
                        Code:
                        if (newField) {
                            cDepartureDate = newField
                        }
                        In the Gravity Forms, use the "newField" for date data transferring.

                        Comment

                        • Nth20
                          Member
                          • Jun 2025
                          • 30

                          #27
                          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?

                          Code:
                          if Date from Hanoi {
                          cDepartureDate = Date from Hanoi
                          }
                          if Date from Sapa {
                          creturnDate = Date from Sapa
                          }​
                          Is this code correct please?
                          Thanks in advance for your help!

                          Comment

                          • lazovic
                            Super Moderator
                            • Jan 2022
                            • 1132

                            #28
                            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

                            Working...