Using logic5 Min.

How to use WordPress variables in your form

With the hidden field block in Tripetto you can instantly collect and use WordPress variables, like user information, website data, visitor data and server data.


When to use

There are lots of use cases in which you can use certain variables from outside the form to make your form more smart or more personal. In the WordPress plugin you can collect such data instantly. Some use cases:

  • Get the email address of the logged in WordPress user, so the user does not have to enter the email address;
  • Collect the IP addresses of your respondents to filter duplicate entries from your results data afterwards;
  • Gather the referrer URL to see where the respondent came from before entering your form.
Screenshot of variables in a form in Tripetto
Demonstration of WordPress variables in a Tripetto form.

📌 Also see: Hidden field block

In the article you're reading now we describe how to use WordPress variables in your form. We use the hidden field block for that. For global instructions about the hidden field block, please have a look at this article:


How to use

WordPress variables are part of the hidden field block.

Add hidden field block

First add a hidden field block and open it in the builder. You can add it in any given position and in an unlimited amount inside your forms.

You can give your hidden field block a Name so you can recognize it in your form's structure and dataset. This name is not visible for your respondents.

Select WordPress variable

In the hidden field block you'll see a dropdown menu Type of field. That determines the data you want to collect with this hidden field block. Part of the options are WordPress specific variables. The following WordPress variables are available:

  • User information
    • Username - Retrieves the value of User / Username;
    • Nickname - Retrieves the value of User / Nickname;
    • Display name - Retrieves the value of User / Display name;
    • First name - Retrieves the value of User / First name;
    • Last name - Retrieves the value of User / Last name;
    • Email address - Retrieves the value of User / Email address;
    • Website - Retrieves the value of User / Website;
    • Biographical info - Retrieves the value of User / Biographical info;
    • Avatar (URL) - Retrieves the value of User / Avatar (URL);
    • Language - Retrieves the value of User / Language;
    • ID - Retrieves the value of User / ID.
  • Website information
    • URL - Retrieves the value of Website / URL;
    • Title - Retrieves the value of Website / Title;
    • Tagline - Retrieves the value of Website / Tagline;
    • Administration email address - Retrieves the value of Website / Administration email address;
    • Language - Retrieves the value of Website / Language.
  • Visitor information
    • IP address - Retrieves the value of Visitor / IP address;
    • Language - Retrieves the value of Visitor / Language;
    • Referrer URL - Retrieves the value of Visitor / Referrer URL.
  • Server information
    • URL - Retrieves the value of Server / URL;
    • Protocol - Retrieves the value of Server / Protocol;
    • Port - Retrieves the value of Server / Port;
    • Host name - Retrieves the value of Server / Host name;
    • Path - Retrieves the value of Server / Path;
    • Querystring - Retrieves the value of Server / Querystring;
    • IP address - Retrieves the value of Server / IP address;
    • Software - Retrieves the value of Server / Software;
    • WordPress version - Retrieves the value of Server / WordPress version;
    • PHP version - Retrieves the value of Server / PHP version.

Just select the WordPress variable you want to collect and that's it! The hidden field block will now collect and store the selected WordPress variable in your form.

Screenshot of a hidden field block with WordPress variable in Tripetto
A form setup with several hidden field blocks that collect WordPress variables.

Important! Data privacy legislation

Please be aware you comply with any data privacy legislation that affects your data gathering. With the WordPress variables in the hidden field block, it's possible to collect personal information that may be subject to data privacy legislation. Tripetto does not collect any personal information on its own, so it's your own responsibility which personal information you collect and to comply to data privacy legislation. Data privacy legislation can differ per worldwide location, so please make sure you comply to the legislation that applies to your form.

Example: collecting IP addresses in accordance with European legislation (GDPR)

In Europe the General Data Protection Regulation (GDPR) applies to all data you collect. This states that IP addresses should be considered as personal data and thus collecting such data must comply with the corresponding GDPR legislation. It's your own responsibility to decide if you need to collect IP addresses and to comply to the rules set by the GDPR.


Use WordPress variable

Now the hidden field block automatically collects the WordPress variable you selected. In general you can now do the following with the value in that hidden field block:

  • Save variable in dataset;
  • Show variable in form (piping logic);
  • Use variable as value in other input block;
  • Use variable as logic condition (branch logic).

We will explain each of these possibilities below.

Save variable in dataset

By default the value of each hidden field block will be saved to your dataset. That way the variable will be available in your results, exports, notifications and webhooks.

Show variable in form (piping logic)

You can show the variable to your respondent in the form in realtime. All hidden field blocks are available for piping logic, by typing the @ sign at the position you want to show the value.

Have a look at this article for more information about piping logic.

Use variable as value in other input block

The variable can also be used to set the value of other input blocks in your form, for example to update the value of an email address input block with the email address of the WordPress user.

Have a look at this article for more information about the set value block.

Use variable as logic condition (branch logic)

You can use the variable to check if a certain branch applies to your filter for that branch.

Have a look at this article for more information about branch logic.

More information

The WordPress variables are part of the hidden field block: How to use the hidden field block.

In this article

    Help us improve