Apply

How to use In-Form Piping

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:

  1. Add an Identifier to the question you are piping from
  2. Create a question to pipe your response into
  3. Depending on the question type (see table below) enter your variable in the corresponding field
  4. Start your expression by adding 2 curly brackets {{
  5. Add a space after the second bracket
  6. Enter the exact identifier you gave to the question you are piping from
    NOTE: Identifiers are case sensitive
  7. After your expression add a space. 
  8. Close your rule with 2 closed curly brackets }}

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 TypeField to Pipe into
Section HeadingTitle or Description
Text ResponseInitial Value field
Hidden ValueHidden Value field
Single Column - Text ResponseInitial Value field
Multi-Column - Text ResponseInitial 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:

QuestionQuestion IdentifierExpression
Total Expensestotal_expenses{{ SUM(expenses[:0]) }}
Total Revenuetotal_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 CalculationCorrect 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.

QuestionIdentifierPiped Response
Question 1q1 
Question 2q2{{ q1 }}
Question 3q3{{ 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.

Question TypeHow it appears
Section HeadingYou 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 ResponseThe exact value given to the Text Response will be piped into the new field.
Multiple ChoiceThe choice selected by the user will be piped into the new field.
DropdownThe choice selected by the user will be piped into the new field.
CheckboxAll 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 ColumnThis will pipe in the responses given to each variable type.
TIP! Use cell indexing, to pipe a specific response from the question.
Multi-ColumnThis will pipe in the responses given to each variable type.
TIP! Use grid indexing, to pipe a specific response from the question.
Hidden FieldPipes the value entered into the Hidden Field.
NOTE: Hidden fields can only be viewed and edited by administrators.
Date/TimeYou will not be able to pipe from this question type.
Datasource QuestionYou will not be able to pipe from this question type.
Drill DownWill pipe the final choice selected into the new field.
NOTE: This will not pipe in the initial category that is selected
Ranking QuestionThe order of your variables will be piped into a list. 
NOTE: Only the choices themselves will be piped, not the corresponding variables. 
JavaScriptYou will not be able to pipe from this question type.
SignatureYou will not be able to pipe from this question type.