Using logic6 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 le's 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 quiz in Tripetto
Demonstration of prefilling a question block from the URL (?name=Julie).

Tip

You just want to prefill question blocks? We made a dedicated article about that use case, as that's the most common usage of the set value block: How to prefill question blocks with the right values.

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 make that supereasy.

In the Purpose feature you can choose what's your goal with this set value block. Depening on your 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.

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.

By clicking the button at the bottom of the Values list you add a value action. From the 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.
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 anymore;
    • Unlock - Unlock the value of the block, so the value can be changed afterwards.
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.


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.

Discover our form blocks

How to use the...
In this article

    Help us improve