TEXTJOIN Formula

Overview

The TEXTJOIN function is a formula that combines multiple variables or strings into a single string. You can also specify a delimiter that's inserted between each joined value. This could be a character (like a comma or ampersand) or an empty space. You can also choose to include or skip empty cells.

Consider a practical example of when you'd use the TEXTJOIN formula. Suppose you have an application where end-users enter a first and last name in separate  Text Fields. But you also want to create a field that stores their full name as a single value. You can use the TEXTJOIN formula in a  Calculator component to join those strings. And an empty space would be a fitting delimiter.

The TEXTJOIN formula isn't suitable for joining an array of values into a single string. When using TEXTJOIN on an array, the Calculator only outputs a comma-separated list of all values in the array. The Calculator ignores the delimiter and ignore_empty parts set in the formula. To join values from an array, use the Join operator in a Data Workflow component.

To learn about additional formulas supported in the Initializer, Calculator, and Data Workflow components, view our Supported Formulas documentation.

What You'll Learn

After completing this article, you’ll learn about the parts of a TEXTJOIN formula and how to use one in a Calculator component.

The function signature for the TEXTJOIN formula is:

=TEXTJOIN("{delimiter}", {ignore_empty}, {"value1"}, {"value2"}, {…}).

This outputs a string of concatenated values, all separated by a delimiter.

Argument

Description

delimiter

Specify a delimiter used to separate your values. For example, a space (" "), comma (","), ampersand ("&"), or even a combination of characters. If you don't set a delimiter, the function concatenates all values without a delimiter. You must surround the delimiter in quotation marks. If you use a number as a string delimiter, the Calculator treats the number as text.

ignore_empty

Specify whether to exclude empty values from the final output. If you enter TRUE, the Calculator excludes any empty values from the final output. If you enter FALSE, the Calculator does not exclude empty values from the output.

value1, value2...

Lists the strings you want to be concatenated. You can use an alias to dynamically reference input from another component in your module. Or, you can hard-code the value. You can also combine alias values and hard-coded values. For example, =TEXTJOIN(" ", TRUE, "Hello", A, B) joins the word Hello with the values from the inputs assigned the aliases A and B.

When hard-coding values, you must surround the value in quotation marks. If your value is not in quotation marks, the component assumes the value is a Property ID in the module. You don't surround aliases with quotation marks.

For this example, you'll build an app that takes a first and last name and joins them together in a sentence. The final output becomes "My name is {firstName} {lastName}", separated by spaces.

These instructions assume that you have an open module saved with a title.

What You Need

For this configuration, you need the following components:

Configure the Text Field Components

Start the configuration by adding three  Text Field components for a first name, last name, and a field to display the joined sentence.

1. From the Module Builder, drag and drop a  Text Field component onto your canvas.
2. In the Property ID field, enter firstName.
3. In the Label Text field, enter First Name.
4. Click Save & Close.
5. Repeat this process for the two remaining  Text Field components, placing them under the firstName  Text Field component:

Property ID

Label Text

lastName

Last Name

yourName

Your Name

6. In the yourName  Text Field component, set Disable User Input to  (ON). This field auto-populates with the joined sentence and does not need to be editable.

A static image displaying the yourName Text Field component. The Property ID and Label Text are filled out, and the Disable User Input toggle is set to ON.(click image to expand)

7. Save & Close each component as you add it.

Configure the Calculator Component

The calcTextJoin  Calculator component contains the TEXTJOIN formula. The formula combines hard-coded values with aliases, allowing you to dynamically substitute the end-user's first and last name in the formula.

1. Drag and drop a  Calculator component onto your canvas, placing it between the lastName and yourName  Text Field components.
2. In the Property ID and Canvas Label Text fields, enter calcTextJoin.
3. From the component's configuration window, select Actions Icon Actions.
4. In the Inputs table, enter the following:
 

Property ID

Alias

Required

1

firstName

A

☐ (unchecked)

2

lastName

B

☐ (unchecked)

5. In the Outputs table, enter the following:
 

Property ID

Formula

1

yourName

=TEXTJOIN(" ",TRUE,"My name is",A,B)

You could also write this formula as =TEXTJOIN(" ", TRUE, "My", "name", "is", A, B).

A static image displaying the calcTextJoin Calculator component's Actions settings. The Inputs table includes the firstName and lastName fields, and the Outputs conmtains the yourName field.(click image to expand)

6. Click Save & Close.

Configure the Button Component

Finally, the btnRunCalc Button component Icon Button component triggers the calcTextJoin  Calculator component.

1. Drag and drop a Button component Icon Button component onto your canvas, placing it below the yourName  Text Field component.
2. In the Property ID field, enter btnRunCalc.
3. In the Label Text field, enter Run Calculator.
4. From the component's configuration window, select Actions Icon Actions.
5. Set the Action Type as Event.
6. In the On-Click field, enter or select calcTextJoin.

A static image displaying the btnRunCalc Button component's Action settings. The Action Type is set to Event, and the Triggers On Click field is set to calcTextJoin.(click image to expand)

7. Click Save & Close.
8. Save your module.

Preview your module in Express View. Fill out the first and last name fields and click Submit. My name is {firstName} {lastName} appears in the Your Name text field:

Resources