Pre-filling is for when you already know some of the answers before your users come to their form, you can pre-fill those answers for them.

How to pre-fill an answer to a question

Pre-filling answers is really easy! Every question has unique key for pre-filling, called it’s pre-fill key. You can use this key in the URL to pass an answer for that question.
The pre-fill key for a question is located at the bottom of the question’s “Configure” section.

In the above screenshot, the pre-fill key is “a0s0h”. If you want, you can also use your own pre-fill key by typing it in the “Custom Pre-fill Key” box.

Ok, so now you use this key in the form’s URL.

You can add multiple answers to a form by adding in an “&” in between the answers.

Here’s an example of how it works with a form URL https://prefilling.paperform.co With two answers pre-filled with the keys 1sgr2 and 1q797, the URL would look like this https://prefilling.paperform.co?1sgr2=Answer1&1q797=Answer2.

Still confused? Have a play with the simple pre-fill generator at https://prefilling-generator.paperform.co.

Note that this tool only allows for two pre-filled answers, but it is a good example of how to add multiple pre-fills in the same URL.

How to pre-fill on an embedded form

Pre-filling on an embedded form is very similar to pre-filling via the URL. First test the pre-filling directly on the URL. Then copy everything from the URL after the “?”. E.g. from the URL in the previous section, you would copy 1sgr2=Answer 1&1q797=Answer 2.

Go to the embed code of your embedded form, and add data-prefill="URL_VALUES" before “data-paperform-id”, where URL_VALUES is the copied end of the URL. This would look like:

<div data-prefill="URL_VALUES" data-paperform-id="prefilling"></div><script>(function() {var script = document.createElement('script'); script.src = "https://paperform.co/__embed"; document.body.appendChild(script); })()</script>

or with the values replaced;

<div data-prefill="1sgr2=Answer 1&1q797=Answer 2" data-paperform-id="prefilling"></div><script>(function() {var script = document.createElement('script'); script.src = "https://paperform.co/__embed"; document.body.appendChild(script); })()</script>

Dynamically pre-filling an embedded form

You can also dynamically pre-fill an embedded form. You can pass the same URL values that would pre-fill the form directly in the URL of the page you’re embedded on. Add data-prefill-inherit="1" to your embed script to enable this functionality. For example, the above script would become;

<div data-prefill-inherit="1" data-paperform-id="prefilling"></div><script>(function() {var script = document.createElement('script'); script.src = "https://paperform.co/__embed"; document.body.appendChild(script); })()</script>

Pre-filling emails

If you would just like to pre-fill an email address, there is a shortcut! Instead of using the question’s pre-fill key like above, you can simply add ?email=test@test.com to the end of any form URL, and any questions of the type “email” will have the provided answer.

Pre-selecting products

You can pre-select products by passing in the SKU of the desired product.

Pre-selecting multiple choice/dropdown questions

If the question you are answering needs to have multiple answers, you can simply pass both values in the URL, one after the other. This would look like this KEY=Option 1&KEY=Option 2.

Pre-selecting Yes/No Questions

For Yes/No questions just pass “Yes” or “No” as the answer. Note that case is important.

Pre-filling date fields

Dates can be pre-filled using the format KEY=yyyy-mm-dd.

Pre-filling hidden fields

Sometimes you want to pass information through the URL and not display it to the user. For that exact purpose there is a “hidden” question type. Hidden fields are never shown to the user, but whatever value they have is still submitted.

Did this answer your question?