Apply

How to Concatenate Values in a Form (CONCAT)

Using Advanced Expression Piping within your forms you can create mathematical formulas in order to calculate a value. This article will explain the process of using the CONCAT function to concatenate (merge) values into one cell in a form.

The CONCAT function accepts a list of floating or integer values and merges each of the values together into a single integer. This can either be used for a single row or column within a grid question, the table as a whole or a list of variables within the form.

An example use case of the CONCAT Function, would be if for reporting purposes, you want to report on the area codes of a phone number, therefore you have the applicants enter the area code in separate test response field then the rest of the phone number. 

Within a hidden field in the form you could then use the CONCAT function to concatenate the area code with the rest of the phone number in order to have the entire number in one field. 

The setup and formatting of the CONCAT expression is imperative in preventing an error message from appearing on your form where the result of your expression would normally appear. The first line of the CONCAT expression should be set up as follows:

{{ CONCAT(variable1,variable2) }}
CONCAT OperationCONCAT ExpressionResult
CONCAT Select Cells{{ CONCAT(q1[0],q1[2],q1[3]) }}Based on Grid Indexing, this will merge the 1st, 3rd, and 4th cells. 
CONCAT a Column{{ CONCAT(q1[:0]) }}Based on Grid Indexing, this will merge all values in Column 1.
CONCAT a Row{{ CONCAT(q2[1:]) }}Based on Grid Indexing, this will merge all values in Row 2.
CONCAT a Range{{ CONCAT(q1[0:4]) }}Based on Grid Indexing, this will merge the first 4 cells.
CONCAT Reviewer Scores{{ CONCAT(q1.score,q2.score,q3.score) }}Concatenate the scores given to the included questions.

The CONCAT function would not be able to perform any operations using an expression such as addition (+) nor would it be possible to have other functions within a single CONCAT function such as SUM to calculate the different variables together to then find the smallest value.

If you are planning on using fields that are created through expression piping, you will need to perform the function on one page and then pipe those fields into the next page using the CONCAT function.