Get started > Use case scenarios - customizing with business rules > Using rules to concatenate multiple text into one field

Using rules to concatenate multiple text into one field

The following use case demonstrates how you can concatenate text into one field. This is achieved by using the concat function.

Assume you want to have the Title for requests conform to a standard pattern of a prefix and the Display label of the related offering.

Create the rule

  1. From the main menu, select Administration > Configuration > Records > Processes and Rules.

  2. Select the Request record type.

  3. In the tree on the left, select Request (the top level of the tree).
  4. In After change, click Add, then select Simple rule.

  5. In Actions, select Set field.

  6. Click OK.

    Screenshot of simple rule

Edit the rule

  1. Click field, and select Title. Then click OK.

  2. Click value, and paste in the following expression:

    ${concat('Your Added Prefix ', entity.RequestsOffering.DisplayLabel)}
  3. Then click OK.
  4. Click Save.

    Screenshot of edited rule

Implementation

Using the preceding rule, when there is a change to a request, the title becomes Your Added Prefix and the Display Label of the related offering. The following shows the effect on the request title when the display label of the offering is Laptop replacement.

Screenshot of record with changed title

Tip Depending on the particular use case, the best practice would typically be for the rule to run only once. You could achieve this by adding the rule to a transition, or using a condition.