@sougata_bose The best way t handle asynchronous logic that will determine the form submission or not would be to use a custom form and have the HubSpot Forms API post call in the callback to your AJAX call. The HubSpot Form would submit before the AJAX promise would be returned.
Yes, but we send emails depending on the data user submits. User can submit multiple forms with different data. We send emails depending on them from workflows. But if a user is already enrolled and submits another form the data would be overwritten.
We will use this ajax request to check if the user is already in the queue and if yes then store the data in our database so that we can update the data later when user completes the workflow.
For this reason we need this ajax request. But if the form gets submit before the request gets complete, may be we will loose the data.
@sougata_bose We don’t allow cross-origin requests for our API. Your calls would have to be made server-side. If you want to check the contact’s property values prior to submission you will need a custom form that can then send the submission data server-side and check the Contacts API before submitting the data to the Forms API.