& Operator: Concatenating Strings and Numbers

Article Number:040511

Using the "&" operator, you can concatenate multiple field values.
When concatenating strings and numbers, you must use a half-width "&" operator. You cannot use a "+" operator for this purpose.

Fields that can be concatenated with "&" operator

When using the "&" operator to concatenate fields, you can specify the following field types for concatenation.

  • Text
  • Number
  • Calculated
  • Radio button
  • Drop-down
  • Date1
  • Time1
  • Date and time1
  • Lookup2
  • Record created by
  • Record updated by
  • Record created datetime1
  • Record updated datetime1

1: Use the DATE_FORMAT function to specify a formula.
2: If a field's Key Field is a "Link" field (or a "Lookup" field with a "Link" field as the Key Field), that field cannot be referenced by a formula.

Reference: DATE_FORMAT Function: Specifying the Display Format of Date and Time

Steps

This section describes how to concatenate a first name and last name that are entered separately in different fields, using an example of a company directory app.

Image of the app with configured fields: Example of concatenating strings

  1. Click the App Settings icon (the gear-shaped icon) at the upper right of the "View" screen.
    Screenshot: The "App Settings" icon is highlighted

  2. On the "App Settings" screen, click Form tab.

  3. Place two "Text" fields on the app form by dragging the "Text" field displayed in the list of fields on the left side of the screen and then dropping it onto the right area of the screen. Screenshot: Placing "Text" fields

  4. Open the field setting screen of each field, and change its field name and field code. As for the first field, change its field name and field code to "First Name" and "First_Name" respectively. As for the second field, change its field name and field code to "Last Name" and "Last_Name" respectively. Screenshot: A GIF that shows field names and fields codes being changed

  5. On the app form, place the "Text" field to be used for displaying the result of concatenation, and change its field name and field code to "Full Name" and "Full_Name" respectively. Screenshot: Placing the field

  6. Open the field setting screen of the "Full Name" field, select Calculate automatically, and then enter the following formula: First_Name&" "&Last_Name
    A half-width '&' is used for concatenating strings. If you want the result to contain a specific string or a space, use half-width double quotation marks (""). Screenshot: The formula setting for the "Text" field

  7. Click Save on the field setting screen.

  8. Click Save Form on the upper left side of the screen, and then click Update App on the upper right side of the screen. Screenshot: "Update App"

  9. On the confirmation dialog, click Update App.

You have successfully configured a field that concatenates character strings. Screenshot: A formula for concatenating strings is displayed

Enter values into the "First Name" field and the "Last Name" field, and check that the full name automatically appears in the "Full Name" field. Screenshot: Checking that the strings are successfully concatenated

Tips: If there are fields with empty values

Empty fields are concatenated as empty strings.
For example, assume that a field has the following formula set: State/Province&City&Street&Building_Name&" "&Floor. In this case, even when the "Building Name" field is empty, values of other fields are concatenated. Screenshot: The result of concatenation when there is a field with an empty value