Using logic4 Min.

How to prefill question blocks with the right 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;
  • You have two separate email address blocks in your order form: one for the 'Confirmation recipient' and one for the 'Invoice recipient'. Your respondent first fills out the confirmation recipient. Now you can use that entered email address as the prefilled value for the invoice recipient.
Screenshot of a quiz in Tripetto
Demonstration of prefilling a question block from the URL (?name=Julie).

How to use

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.

Step 1 - Add form blocks

First build your form with the question blocks you'd like 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.

Step 2 - 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.

Screenshot of the form builder in Tripetto
Our form setup with an empty set value block at the start of the form.

Step 3 - Add values

All we have to do now is add the desired question blocks and their values. We will show 3 different scenarios:

  • Prefill with a static value;
  • Prefill with a value from the query string;
  • Prefill with a value from another question block/variable in your form.

Step 3.1 - 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:

  1. In the set value block click the button at the bottom of the Values list;
  2. Next select the City question from the form. In our example form this is a dropdown question type;
  3. Now select Fixed value as the desired value;
  4. 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.

Screenshot of the form builder in Tripetto
The setup to prefill with a static value.

Step 3.2 - 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:

  1. 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;
  2. Next select the Name question from the form. In our example form this is a text (single line) question type;
  3. Now select From query string as the desired value;
  4. 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.

Screenshot of the form builder in Tripetto
The setup to prefill with a value from the query string.

Step 3.3 - Prefill with block/variable value

In this example we want to take over the entered value of the 'Confirmation recipient' question into the 'Invoice recipient' question. Follow these steps:

  1. To take over other variables, the set value block has to be entered after the block that you want to take the value from. So for this example we add a new set value block at the end of the form;
  2. In the new set value block click the button at the bottom of the Values list;
  3. Next select the Invoice recipient question from the form. In our example form this is an email address question type;
  4. Now select From other variable as the desired value;
  5. Now select the question block you want to get the value from. In this case that is our Confirmation recipient question.

That's it! Now the form will update the default value of the 'Invoice recipient' question based on the entered value in 'Confirmation recipient' question.

Screenshot of the form builder in Tripetto
The setup to prefill with a value from another question block/variable in your form.

Discover our form blocks

How to use the...
In this article

    Help us improve