Conversation

Pegasystems Inc.
IN
Last activity: 19 Aug 2025 9:08 EDT
Using dynamic texts for your labels
Use Case Description:
As a Pega application user, I want my labels to display dynamic terminology so that we can re-use the same view for each variation.This eliminates the need of circumstancing the views each time we need a new variation.
Challenge:
The variation described is related to regional terminology differences rather than language, which can be addressed during localization. For example, a pharmacy is referred to as a "chemist" in the UK and as a "drugstore" in the USA. In this example, region serves as the differentiator for labels associated with healthcare.
Proposed Solution:
1. Start by setting up a data object to organize your labels by region. It should look like the following:
Note: Use a default description for clarity and context.
One key advantage of utilizing a data object is the ease of managing changes. We can readily set up CRUD actions on this table through landing pages, and it is also more straightforward to read compared to Decision Tables or Data Transforms.
2. Create a Data Page to get the result based on the Label Name.
3. Create a Data Transform to map the default labels in the case initiation.
Note: For each label having dynamic text, we need a corresponding desc field.
You should map each field using this pattern - D_ListReferenceDataByLabel[LabelName:"Refill"].pxResults(1).Default
This will help set the default labels when the case is created.
4. For changing the labels to change of region, create another Data Transform.
Mapping for each field should follow this pattern - D_ListReferenceDataByLabel[LabelName:"Refill"].pxResults(1).USA
5. Now we need to map each description field to the field on the view.
Note : You can add sentences and insert fields as well.
If the mapping is already created, you can see it in the dropdown.
Preview of the change
Once you create a case, default labels are shown.
On change of region, labels will change dynamically.
Rules created under the Hood:
For each label we need
- We have a row in the table.
- A field created for the mapping.
- Some steps in the reusable Data transforms.
- A paragraph rule( created while adding dynamic labels).
Constellation 101 series
Enjoyed this article? See more similar articles in Constellation 101 series.