Piping Variables are helpful for passing information from one field to another. Piping Not only can you pipe information between forms, but you can also pipe information internally within a form. This article introduces in form piping and will cover how to use this piping with the various form question types in order to pass data and perform AEP calculations.
In form piping allows you to pass information from one field to another within in the same form. This is commonly used for Advanced Expression Piping (AEP) when it comes to passing values into formulas. It can also be used to pipe responses between pages.
For example, if the applicant provides their project name at the beginning of the form and you want this to visually appear at the top of each page they access. You can take the responses to the questions on the first page and pipe them into Section Headings on each new page.
Piping can also be done between different forms using generated piping variables. However, what it easier about In-Form piping is that you can simply use the Question Identifier to pass the information instead of a lengthy piping variable.
o set up piping within your form:
For example, if "Organization Name" is your original question and the identifier is "org_name" we would use {{ org_name }} as the In-Form Piping variable. Any reference to this field outside of the form must use the system generated piping variable.
You can pipe response into the following question types:
Question Type | Field to Pipe into |
Section Heading | Title or Description |
Text Response | Initial Value field |
Hidden Value | Hidden Value field |
Single Column - Text Response | Initial Value field |
Multi-Column - Text Response | Initial Value field |
When performing In-Form Piping, although it is possible to perform piping within the same page there is one major limitation: you are not able to pipe from a piped variable within the same page. The below section will outline the process for both Advanced Expression Piping and Basic Piping Variables.
For example, within our form, we are trying to calculate revenue and expenses. Therefore with our budget we calculate the totals into two fields into a new field using an AEP Formula:
Question | Question Identifier | Expression |
Total Expenses | total_expenses | {{ SUM(expenses[:0]) }} |
Total Revenue | total_revenue | {{ SUM(revenue[:0]) }} |
Now that we have the values for each of the totals we want to find the difference between them to find the total income.
If it’s required to have this calculation on a single page, use a combination of SUM expressions to calculate on the same page instead. This is shown in the table below:
Incorrect Calculation | Correct Calculation | |
Total Income | {{ total_revenue-total_expenses }} | {{ SUM(revenue[:0])-SUM(expenses[:0]) }} |
The restriction implied is that we will not be able to use "total_revenue" and "total_expenses" within a new formula on the same page. Therefore {{ total_revenue-total_expenses }} will not work correctly if the formula exists on the same page as the Total Revenue and Total Expenses questions.
TIP! Alternatively, as a workaround you can use the original sum calculations to get the same result.
In order for this formula to calculate "total_revenue" and "total_expenses" correctly, you will need to create a new page and place the Total Income formula on the new page.
The same logic stated above for Advanced Expression Piping, will also affect Basic Piping Variables within a form. As you will not be able to pipe into a question, and then use that piped variable to pipe into another question on the same page.
For example, the following piping cannot be met if the last two questions exist on the same page.
Question | Identifier | Piped Response |
Question 1 | q1 | |
Question 2 | q2 | {{ q1 }} |
Question 3 | q3 | {{ q2 }} <-- this value may error out due to question 2's response being a piped value. |
Provided below is a list of each question type available within the form and how they will appear once they are piped into another question.
Some question types do not support piping.
Question Type | How it appears |
Section Heading | You will not be able to pipe from this question type. However, you will be able to pipe into the Section Heading Title and Description from other question types. |
Text Response | The exact value given to the Text Response will be piped into the new field. |
Multiple Choice | The choice selected by the user will be piped into the new field. |
Dropdown | The choice selected by the user will be piped into the new field. |
Checkbox | All choices selected will be piped into the new field in a list, separated by commas (no spaces). Example: Choice 1,Choice 2,Choice 3. |
Single Column | This will pipe in the responses given to each variable type. TIP! Use cell indexing, to pipe a specific response from the question. |
Multi-Column | This will pipe in the responses given to each variable type. TIP! Use grid indexing, to pipe a specific response from the question. |
Hidden Field | Pipes the value entered into the Hidden Field. NOTE: Hidden fields can only be viewed and edited by administrators. |
Date/Time | You will not be able to pipe from this question type. |
Datasource Question | You will not be able to pipe from this question type. |
Drill Down | Will pipe the final choice selected into the new field. NOTE: This will not pipe in the initial category that is selected |
Ranking Question | The order of your variables will be piped into a list. NOTE: Only the choices themselves will be piped, not the corresponding variables. |
JavaScript | You will not be able to pipe from this question type. |
Signature | You will not be able to pipe from this question type. |