Progressive Profiling info in API response



I'm creating front-end APP that uses HubSpot API to dynamically show HS forms and send form data do HS. I have a problem with Progressive Profiling. I don't know how to distinguish fields that should be visible, from fields that should be hidden because they have been already filled in before.

I've created example form in HS. Most of the fields are marked as progressive except email adress. I have tried to embed this form in two ways - by including JavaScript from HS and by creating my own implementation. In first scenario progressive profiling works fine - at first the form contains all fields. After filling it and sending the form shows only non-progressive fields and the email address is visible but already filled in.

In my own implementation I'm trying to do the same but the data I'm gettin from the API does not inform me if field should be hidden or not. Anyone can tell me which field in API response informs about state of the field?

My example form:


@Peronczyk In the API response if the field has a value then you know it has already been submitted and you do not need to ask it again. We don't have a field state value but that is because you can determine the state from if the value is known or not from the field.


Thank you @pmanca for your response.

I have another 2 question in this topic:

  1. So what is the exact name of the field that contains value? Is it just "value"? :slight_smile:
  2. What is the best way to get HS form data from API to get Progressive Profilling work? At this moment I'm using backend middleware to collect data from HS and than pass it to my app. This prevents from showing "hutk" to browser/user. But is this a good way? Will this middleware block Progressive Profiling?

  1. Yes it is "value"
  2. Yes you will need to proxy the information as you are doing because we don't allow client-side requests.


Ad 2. So how HubSpot is detecting coming back user if the form data is fetched by backend proxy?


@Peronczyk Through the cookie, You can pass the cookie initially to the backend proxy which would then use that info to fetch the corresponding contact from HubSpot


@pmanca so how to pass information about the cookie to HS API while getting form data? There is no info about that in this page: and this

Also You've wrote that there will be 'value' in response but there is no info about that in API DOCS. Why there is only "defaultValue" described?


@Peronczyk This is the endpoint you need.


@pmanca correct me if I'm wrong: to make Progressive Profiling working I need to make 2 separate calls (form and contact) and compare the data to get form filled in with collected data?


@Peronczyk You need to make two calls, One from the client to the proxy server and then one from the proxy server to the HubSpot to get the information. You will use the Contacts API with HubSpot and not the forms API.


After the user submits the data on your form you will use the forms API to enter the info into HubSpot.


Thank you, Your answers helped.

I have (I hope so) last question: how to generate and set 'hubspotutk' entry in Cookies. For example: new user enters my page - he don't have 'hubspotutk' in his cookies. He fills in HubSpot form and send it, so his data is now stored in HubSpot and contact is created. I want to mark him with 'hubspotutk' but I don't know how to receive it.


@Peronczyk So long as the tracking code is on the page the cookie will get created automatically as soon as he enters your page. Then you can associate that cookie to the email address through the form submission.


Thank you for your help @pmanca