How to add Hidden fields for an existing form using an API. | Community
Skip to main content
Answered

How to add Hidden fields for an existing form using an API.


If a form is already created using the Typeform portal and then I want to update the hidden fields for that form. How can we do that?

Best answer by picsoung

Hey @ankit 

Are you creating forms via the APIs too? or manually in the builder?

If you do it via API, you can also specify hidden fields at the moment of creation under the hidden property.

"hidden": [
    "user_id",
    "email",
    "another_hidden_field"
  ]


And via the builder, if your forms are similar, hidden fields should be copied when you duplicate a form.

If you want to change the value of a hidden field, so need to make an API call. Just change it’s value in the url

examples:
https://form.typeform.com/to/form1234#email=nico@lol.com
https://form.typeform.com/to/form1234#email=pedro@jojo.com

Hidden fields work as a “catch all”, we will grab the value passed in the url and store it with the answers submitted in the form.

View original

11 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15035 replies
  • March 9, 2021

Hi @ankit thanks for stopping by! If you want to update the hidden fields, you’ll want to use this call here. It’s important to note that it will update the entire form, as we don’t have a way yet to add just one field (or fields) without updating the entire form. You can see the PATCH option here. Hope that helps a bit!


  • Author
  • Explorer
  • 6 replies
  • March 10, 2021

Hi @Liz, I tried with the PATCH option but it is not working. It is saying “NOT_ALLOWED_VALUE”.

So means, every time we are creating a form, we need to pass the hidden field manually.


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 15035 replies
  • March 10, 2021

Hi @ankit the PATCH option won’t work for just adding hidden fields if you don’t include the entire form definition. This means that you’ll need to re-add each question in addition to adding the hidden fields. If that doesn’t work, would you mind sharing the call you’re making? 


picsoung
Typeform
Forum|alt.badge.img+5
  • Developer Advocate @ Typeform
  • 392 replies
  • Answer
  • March 19, 2021

Hey @ankit 

Are you creating forms via the APIs too? or manually in the builder?

If you do it via API, you can also specify hidden fields at the moment of creation under the hidden property.

"hidden": [
    "user_id",
    "email",
    "another_hidden_field"
  ]


And via the builder, if your forms are similar, hidden fields should be copied when you duplicate a form.

If you want to change the value of a hidden field, so need to make an API call. Just change it’s value in the url

examples:
https://form.typeform.com/to/form1234#email=nico@lol.com
https://form.typeform.com/to/form1234#email=pedro@jojo.com

Hidden fields work as a “catch all”, we will grab the value passed in the url and store it with the answers submitted in the form.


  • Author
  • Explorer
  • 6 replies
  • March 20, 2021

Hi Picsoung,

We are creating the forms manually in the builder. We want to add new hidden fields via API, not to update the value.


  • Navigating the Land
  • 3 replies
  • November 17, 2022

Bumping this post, as adding hidden fields via the PATCH method is something I/my team would love to see support for as well. 

In fact, due to the automation tool we’re using and the fact that our users create forms via UI, it is the only way we can add our hidden fields to users’ typeforms


  • Navigating the Land
  • 3 replies
  • August 31, 2023

Any chance this will ever be addressed?


picsoung
Typeform
Forum|alt.badge.img+5
  • Developer Advocate @ Typeform
  • 392 replies
  • August 31, 2023

Hi @nelav 

Thank you for your feedback.

We haven’t planned to extend the possibility of the PATCH endpoint.

Which automation tool are you using at the moment?

You will need to first get the form
GET https://api.typeform.com/forms/form1234

Extract the JSON, change the properties as needed
And then upload the modified JSON using 

PUT https://form.typeform.com/to/form1234

Hope this makes sense


  • Navigating the Land
  • 3 replies
  • September 1, 2023

Thanks, I do understand it. Our team is using Make/Integromat, unfortunately it doesn’t support grabbing the full JSON body, only mapping specific properties. With an unknown # of form fields and nested values, this approach won’t work with the “grab everything and PUT” method, only with the targetted PATCH approach, unless I’m missing something.


  • Navigating the Land
  • 1 reply
  • May 28, 2025

Bumping this as well. We have some users coming to our system who have existing typeforms that use features not supported to update or apply in the API. So reposting the entire form is not possible.

When we create a base form for them from our system it embeds some hidden fields for them to use from our system to use in their questions when launching the form from within our system including key association fields that allow the form to be easily tracked to a specific project etc.

Thus we have to tell them to manually add the hidden fields to their form through its settings making the work on their part harder than it needs to be, and potentially error prone.

Thanks for your help!


picsoung
Typeform
Forum|alt.badge.img+5
  • Developer Advocate @ Typeform
  • 392 replies
  • June 2, 2025

Hi ​@dergoog 
Would you mind providing more details?
Feel free to reach out directly to our support team, if you don’t want to disclose too much here.

If you are dealing with customers’ forms, they should authorize your app to access their typeform account via OAuth consent flow. You can read more about it in our developer documentation.

Once authorized, you will get an access token to manipulate their forms via the API.
No need for manual work.

Let us know if you have trouble integrating,
 


Reply