Data storage4 Min.

How to share response data between forms

With some smart usage of the features of Tripetto you can connect multiple Tripetto forms to each other and share response data between them.


The concept

Imagine you've got two separate forms. In the first form you've collected some data, for example the name of your respondent. Now you want to use that name from the first form in the second form, so your respondent doesn't have to enter this again.

Preparation

First make sure you have created both forms, so you know the URL of your second form that you want to redirect to.

Form 1 - Send data with a redirect URL

In the first form (that already contains the name question), we have to make sure the data is sent to the second form. To do so, we enable the redirect at the end of the form and insert the URL of the second form to redirect to.

Screenshot of redirect in Tripetto
Set up the query string in the redirect URL.

Now we're going to extend that URL with a query string to pass the desired data to. You can determine the name of the parameter yourself. In this case we will use firstname as parameter name. Now we attach the answer of the name question to it, by typing the @ sign and select the right question (more information on piping logic over here).

📣 Info: About query strings

A query string is an often used method to send data in a URL. Some background information on how to supply a query string:

  • You can add multiple parameters to a query string;
  • Each parameter consists of a name and a value, separated by a = sign, for example name=value;
  • The first parameter is preceded by a ? sign;
  • Any following parameters are preceded by a & sign;

A full example could be something like this: https://yoursite.com/?name=abc&city=klm&country=xyz.

Form 2 - Receive data with a hidden field block

Screenshot of hidden field in Tripetto
Set up the hidden field.

Now over to the second form. Over there we need to receive the data that is sent by the first form through the query string.

To do so, we add a hidden field block to the second form and set that up to read the query string. And in this case we want to read the value of a certain parameter inside the query string, so we enable the feature Parameter at the left and then enter the name of our parameter, in this case firstname.

Now the hidden field block will be filled automatically at the moment the form is opened. In our case that moment is when the first form redirects to the second form, including the query string.

Screenshot of hidden field in Tripetto
Example of the first name shared between two forms.

Connect responses to each other

The responses of your two forms remain separated from each other. But you can do a little trick to be able to manually connect two responses of the same person from different forms. That uses the same concept as above, but with a different parameter.

Each form entry gets a unique identification number when it's saved. In the first form you can use that Identification number as piping value in the redirect URL. That sends the unique identification number of the response of that first form to the second form.

By saving that identification number in a hidden field in the entry of the second form, you have saved a reference to the corresponding entry of the first form.

In the CSV exports you make of both forms, you can now connect the two separate entries to each other, as the identification number of the first form is also saved to the entry of the second form.

In this article

    Help us improve