When working with situations where there are lots of calculated attributes that are generated, for example, from a simple set of data entry items (think of entering 3 or 4 attribute values that you then use to calculate lots of things – the user gives you their date of birth, you calculate their age, they give you their last name and you capitalize it and so on) it is often useful to group the calculated attributes together for several reasons, and a Label Extension is one way to achieve that:
- Designing a screen to display so many input and calculated attributes can get very time consuming.
- Displaying very large amounts of information on a Screen, especially inside an Entity Collection, can slow the screen display down considerably
- If the calculated attribute values belong together, then display them together
So one answer is to create a single, concatenated calculated attribute and then use a Label Extension to display the resulting array as a single composite attribute. So for example:

/* Generated by the intelligent-advisor.com Website Code Generator 05/05/2022 09:07
Boilerplate Code of Custom Label Extension for Intelligent Advisor fka Policy Automation
I will remember this is for demonstration purposes only.
*/
OraclePolicyAutomation.AddExtension({
customLabel: function(control, interview) {
if (control.getProperty("type") == "splitter") {
return {
mount: function(el) {
var div_parent = document.createElement("div");
div_parent.id = "customSplitterLabel_parent";
var div = document.createElement("div");
div.id = "customSplitterLabel";
var arrayofvalues = interview.getValue("array").split("!" )
var finaltext =""
var interimtext;
for (let i = 0; i < arrayofvalues.length; i++) {
interimtext = "Calculated Value #" + i + " : " + arrayofvalues[i] + "<BR>"
finaltext += interimtext;
}
div.innerHTML = finaltext;
div_parent.appendChild(div);
el.appendChild(div_parent);
},
update: function(el) {},
unmount: function(el) {}
}
}
}
})

So the output looks like this video, which demonstrates the capture of the data and the display of the result in the Label Extension. The nice thing about this technique is of course you can take it much further:
- You can of course add as many different attributes into your composite label as you wish, it will spit them out correctly.
But this example means mixing technical and business rules in Word. You can remove the text rule from the Word document if you wish and add it to the JavaScript file, to separate the technical stuff from the business rules. So in the case shown, the Word would now look like this:

OraclePolicyAutomation.AddExtension({
customLabel: function (control, interview) {
if (control.getProperty("type") == "splitter") {
return {
mount: function (el) {
// remember to create opm.extension.data.json file with attribute names in it
// and load the values using interview.getExtensionData() if they are not being displayed on this Screen
interview.getExtensionData();
var div_parent = document.createElement("div");
div_parent.id = "customSplitterLabel_parent";
var div = document.createElement("div");
div.id = "customSplitterLabel";
// build the composite
var composite = interview.getValue("firstlength") + "!" + interview.getValue("age").toString() + "!" + interview.getValue("upper")
// create array
var arrayofvalues = composite.split("!")
var finaltext = ""
var interimtext;
// iterate
for (let i = 0; i < arrayofvalues.length; i++) {
interimtext = "Calculated Value #" + i + " : " + arrayofvalues[i] + "<BR>"
finaltext += interimtext;
}
// display both
div.innerHTML = composite + "<BR><BR>" + finaltext;
div_parent.appendChild(div);
el.appendChild(div_parent);
},
update: function (el) {},
unmount: function (el) {}
}
}
}
})
This is not the only way to do this, and small numbers of calculated attributes will not warrant such an approach but it seemed interesting enough to post here. The official documentation can, as always, be found here.

Have a great day!
You might also be interested in these articles: