Form validation / error message + not allow duplicate email
resolver
@Kevin-C They would have to delay the redirect though. I've often run into a problem with trying to use contact properties right after form submission and the submission not having updated the contact quick enough to be usable.
@ikknd He's not talking about using the API, but instead using a contact property after form submission to determine what content is shown on the page you redirect to either using HubL or smart content.
I don't believe Hubspot has any sort of validation available in their API. If you want to validate before/on submission you would need to use the Contacts API to get the contact by their email and then you can either search for a property in the form to see if it's filled out or have a list that users are being put into on form submission and see if they're in that list. Then submit the form or show an error depending on if they're in the list/have the property or not. @Kevin-C does mention serverless functions, this would allow you to use the API without an integration but it's an Enterprise only feature.
That's about as much as I can tell you. I don't really work with the APIs much. 😅
If this answer solved your question, please mark it as the solution.
Form validation / error message + not allow duplicate email
resolver
@Kevin-C They would have to delay the redirect though. I've often run into a problem with trying to use contact properties right after form submission and the submission not having updated the contact quick enough to be usable.
@ikknd He's not talking about using the API, but instead using a contact property after form submission to determine what content is shown on the page you redirect to either using HubL or smart content.
I don't believe Hubspot has any sort of validation available in their API. If you want to validate before/on submission you would need to use the Contacts API to get the contact by their email and then you can either search for a property in the form to see if it's filled out or have a list that users are being put into on form submission and see if they're in that list. Then submit the form or show an error depending on if they're in the list/have the property or not. @Kevin-C does mention serverless functions, this would allow you to use the API without an integration but it's an Enterprise only feature.
That's about as much as I can tell you. I don't really work with the APIs much. 😅
If this answer solved your question, please mark it as the solution.
I also believe @alyssamwilie is correct. But your usecase leads me to believe there might be other options.
I'm wondering if this has to be an api / validation thing. What if the content on the page the contact is redirected to is conditional?
Maybe a hidden boolean contact info field in the form. Then on the redirected page query against that field.
This way we declare what we want to happen based on the contacts info vs checking the submission.
I could also see something like this being done with a serverless function, if you have access to them. But I still feel like the first option might serv you better.
Form validation / error message + not allow duplicate email
resolver
I don't believe this is something you can do efficiently with HubL, javascript, or workflows unless the user's cookie stays intact (which is unlikely), so sorry @dennisedson but I'm no help here. I'm not an API guru 😅
If this answer solved your question, please mark it as the solution.