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.

https://players.brightcove.net/1519050010001/default_default/index.html?videoId=6375741333112

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.

  1. Create a Data Page to get the result based on the Label Name.

  1. 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.

  1. 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

  1. 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.

Thanks for the thorough writeup!

For projects with simpler needs, you can employ the “Use decisioning” feature of Dynamic Text rules.

@Aditi Mehta Tried this. It works in webportal but not working in end user portals. Even the network trace shows the property referred in paragraph has correct value label value set and is not reflecting or refreshing. Something you can verify.

@Kamil Janeczek

@VamseedharaRcan you specify what is webportal as opposed to end user portal?

@peter_bessman I just realized that I was using a pre-release version of the platform here — so stick with the approach outlined in the main post until such time when/if (no promises!) this feature becomes available.

It’s my pleasure to confirm that dynamic text is now available for use in Infinity 25!