APIs & Integrations

Not applicable

Hide form to users who have already submitted it

Hi guys

I have several forms on my website, one of which is contains quite a few fields and is rather detailed. I’d like to be able to hide this form to users who have already filled out.

Currently I am using the HUBL contact variable and checking the lifecycle stage:

{% if contact.lifecyclestage %}
// do nothing
{% else %}
//output form
{% endif %}

however I assume that this means the form will also be hidden if a user fills out any other forms (e.g newsletter subscribe).

How can I hide a form only when a user has already filled out that specific one?

Thanks.

0 Upvotes
4 Replies 4
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Hide form to users who have already submitted it

Hi @rmcdiarmid,

If this is all on an external page, you’d likely need to make a call to the ‘Get contact by usertoken’ endpoint, and then render/hide page content based on the response:

Get a contact by its user token

GET /contacts/v1/contact/utk/:contact_utk/profile - For a given portal, return information about a single contact by its User Token (hubspotutk)

0 Upvotes
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Hide form to users who have already submitted it

Hi @MikeyWallis,

Your best bet might be to use the Smart Content functionality. You can choose to show/hide certain modules based on a contact’s list membership; you could create a smart list of the contacts who submitted your form, and then create a smart rule to hide that form if the contact is a member of that list. This user guide comprehensively covers smart content and how to implement it:

0 Upvotes
rmcdiarmid
Member

Hide form to users who have already submitted it

if I am custom building forms using js and the forms api. I’d like to pull off this same trick - if a person’s ‘leadscore’ is high enough - skip the form entirely - and provide them content - but I need to be able to tell hubspot (presumably through a blind form submission using their cookie’d information) that they visited the page and got the streamlined path to the content.

0 Upvotes
Not applicable

Hide form to users who have already submitted it

Hey Derek

Thanks for this, looks like its working perfectly.