Video tutorial about prefilling questions.
Using logic6 Min.2 Min.

How to use the set value block

Use the set value block to set, change, clear and lock/unlock values in your form. It lets you prefill values in your question blocks, but is also able to perform advanced actions with the values in your form.


When to use

You can use the set value block if you want to perform actions with the values inside question blocks in your form. The most common use case for that is to prefill question blocks with personalized values, but you can also think of actions like updating and/or locking values. Some examples:

  • Prefill the 'Name' question in your form with the name of your respondent;
  • Take over the entered value of the 'Confirmation recipient' question into the 'Invoice recipient' question;
  • Lock given answers in a quiz to prevent cheating: the given answers remain visible, but are not editable;
  • Unlock the 'Email address' question in your form when the respondent indicates the prefilled email address is incorrect.
Screenshot of a prefilled form in Tripetto
Demonstration of prefilling a question block from the URL (?name=Julie).

πŸ“Œ Also see: Use cases

We also offer some dedicated help articles about different use cases for the set value block:

Just want to prefill question blocks?

Want to do more advanced value actions?


How to use

The set value block is available as a question type. Add a new block to your form and then select the question type Set value. You can add it in any given position and in an unlimited amount inside your forms.

Screenshot of the form builder in Tripetto
The set value block is available from the Question type menu.

Positioning the set value block

Please be aware that the position where you place the set value block in your form can influence how it will behave. Two examples to demonstrate:

  • If you place a set value block at the beginning of your form, it will immediately set the values that you define;
  • But if you place a set value block for example inside a branch, then the defined values/actions will only be executed if the respondent enters that branch.

Purpose

The set value block is a rather advanced block, being capable of many actions regarding the values of your blocks. But the most common purpose of it is to prefill values, so we help you to do that supereasy.

In the Purpose feature you can choose what's your goal with this set value block. Depending on your selected purpose, the set value block hides/shows certain settings:

  • Prefilling - This configures all settings automatically so you can easily prefill values, without thinking of any advanced settings;
  • Advanced - This lets you configure all settings yourself so you can perform advanced set value actions.

πŸ“Œ Also see: Use cases

Please have a look at these articles that show use cases of the different purposes:

About the prefilling purpose:

About the advanced purpose:

Values

Next, you will see an empty list of Values. You can fill that list with the desired value actions you want to perform in this block. In one set value block, you can add an unlimited amount of value actions.

You add a value action by clicking the button at the bottom of the Values list. From that menu, select the block in your form that you want to set a value for.

Screenshot of the form builder in Tripetto
Add a value action to the set value block.

Now you can configure the value settings for that block. It depends on the purpose you have selected (prefilling or advanced) which settings are available.

Values - Prefilling

If you have selected the purpose 'prefilling', you only have to determine what will be the value for the selected block. These are the options:

  • Fixed value - Set the value of the block to a fixed value, so all respondents will see the same value prefilled. It depends on the question type of the selected block how you enter the fixed value;
  • From other variable - Set the value of the block similar to a value from another block/variable in your form. You can select the block you want to use the value of;
  • From query string - Set the value of the block to a value that's captured from the query string in the URL (what's a query string?). You can enter the query string parameter that you want to get the value from;
  • Depending on the question type of the block, other value options can become available. For example for a number block you can also use all calculator features instantly.

πŸ“Œ Also see: Prefill values

Please have a look at this article for more information about prefilling question blocks:

Screenshot of the form builder in Tripetto
Settings for a prefilling set value block.

Values - Advanced

If you have selected the purpose 'advanced', you have more settings available to get the right behavior. Now you can control 3 settings:

  • Value

    This determines the value that you want to give to the selected block. These are the options:

    • Do not change - Leave the value of the block unchanged;
    • Fixed value - Set the value of the block to a fixed value, so all respondents will see the same value prefilled. It depends on the question type of the selected block how you enter the fixed value;
    • From other variable - Set the value of the block similar to a value from another block/variable in your form. You can select the block you want to use the value of;
    • From query string - Set the value of the block to a value that's captured from the query string in the URL. You can enter the query string parameter that you want to get the value from;
    • Depending on the question type of the block, other value options can become available. For example for a number block you can also use all calculator features instantly;
    • Clear - Empty the value of the block.
  • Mode

    This determines how the set value action should behave regarding the current value at that time. It depends on the question type of the selected block which options are available, but in general these are the options:

    • Overwrite - Regardless of the value of the block, the configured value will always overwrite the current value of the block;
    • Prefill - Only set the configured value if the current value of the block is empty;
    • Advanced options are available for certain question types, for example for text values and boolean values.
  • Locking

    This determines the lock state that you want to give to the selected block. This way you can enable/disable the ability for your respondents to edit the value of the selected block. These are the options:

    • Do not change - Leave the lock state unchanged;
    • Lock - Lock the value of the block, so the value cannot be changed by the respondent anymore;
    • Unlock - Unlock the value of the block, so the value can be changed by the respondent afterwards.

πŸ“Œ Also see: Update values

Please have a look at this article for more information about using the set value block throughout your form:

Screenshot of the form builder in Tripetto
Settings for an advanced set value block.

Description

You can add a Description to your set value block, so you can recognize what that block does in your form. This will not be visible for your respondents.

Options

  • Status
    By default this block will be executed in your form. Enable the Status feature to disable the execution.

Action block values

One of the options to set the value is taking over the value of another block in your form. You might be thinking of other question blocks, but you can also use the values of other action blocks, for example:

  • From a hidden field block - The hidden field block can contain all sorts of values, like values from query strings, values from JavaScripts variables and browser information. You can use these directly inside the set value block;
  • From a custom variable block - The custom variable block can contain any value that you address to it. You can use that value directly inside the set value block;
  • From a calculator block - The calculator block outputs the outcome of a certain calculation. You can use that outcome directly inside the set value block.

And of course it also works the other way around: you can set the values of such action blocks from outside those blocks.


More information

The set value block has lots of possibilities, so we have several help articles to learn all about it:


Discover our form blocks

How to use the...
In this article

    Help us improve