How to prefill question blocks with initial values
You can enter initial values to your question blocks, so you can help your respondents to fill out your form quickly.
When to use
Normally all forms start with all blank input fields. But in some cases you already know some answers of your respondents, so why not prefill them? By doing so your respondents can complete your form easier and faster, resulting in higher completion rates. Some examples:
- Most of your respondents live in New York City, so in the 'City' question in your form, you prefill 'New York City'. Most of your respondents can now simply accept the answer and continue your form;
- You have sent personalized invitation links to your respondents, so you already know the name of each respondent. The name is part of the form URL that you have sent them. You can now use that value from the URL to prefill in the 'Name' question;
π Also see: Set value block
In the article you're reading now we describe how to prefill values in your question blocks. We use the set value block for that. For global instructions about the set value block, please have a look at this article:
π Also see: Update values
It's important to know that prefilling only works for blocks that don't have a value yet. If you want to update blocks that already have a value, please have a look at this article:
How to use
You can prefill question blocks with the set value block.
Add set value block
First build your form with the question blocks you want to prefill.
Continue with adding a set value block. In this case we add that block at the start of our form, so all our blocks will become prefilled when the respondent opens the form.
Select purpose
Now open the set value block. You will first see the Purpose
feature. Set that to Prefilling
and the builder will make sure all settings are configured correctly for you.
π Also see: Update values
It's important to know that prefilling only works for blocks that don't have a value yet. If you want to update blocks that already have a value, please have a look at this article:
Add values
Now you can make a list of question blocks that you want to prefill with a certain value. Per row in your list you can determine how you want to prefill that, for example:
- Prefill with a static value;
- Prefill with a value from the query string.
Example: prefill with static value
In this example we want to prefill our 'City' question with the fixed value 'New York City', as we know most of our respondents live there. Follow these steps:
- In the set value block click the
button at the bottom of the
Values
list; - Next select the
City
question from the form. In our example form this is a dropdown question type; - Now select
Fixed value
as the desired value; - Now select the right value from the dropdown options, in this case we select
New York City
.
That's it! Now the form will always select 'New York City' as the default selected option.
Example: prefill with query string value
In this example we want to prefill our 'Name' question with a value that we collect from the query string of the form URL (what's a query string?). Our form URL for example looks something like this: https://tripetto.app/your-form/?name=Julie
. Follow these steps:
- We can use the same set value block to prefill multiple question blocks. Just click the
button at the bottom of the
Values
list again; - Next select the
Name
question from the form. In our example form this is a text (single line) question type; - Now select
From query string
as the desired value; - Now enter the query string parameter that you want to use the value of. In this case we want to use the value of parameter
name
.
That's it! Now the form will use the value that's entered in the URL as the default entered text value.
More information
The set value block has lots of possibilities, so we have several help articles to learn all about it: