INTRO
Sometimes you need to enrich your entity view with the combination of attribute values or attributes that belong to some other entity… and there is a way to do it using computed content feature.
Following are the two use cases I happen to encounter most often.
Show parent attribute in a child entity
- You have
reportandreportColumnentities. - Entity
reportColumnis an array of embedded objects insidereport. - Entity
reporthas areportNameattribute.
The goal is to add report.reportName to reportColumn entity as reportName attribute.

High level steps:
- Create a new entity named
reportNameCC, save it, **DO NOT PUBLISH**. - In the
Computed Contenttab of the entity add parameters and SQL. - Edit
reportColumnentity- add embedded object with type
reportNameCC; - add delegate property to embedded
reportNameCC.
- add embedded object with type
Computed Content Entity
- Goto Organization → Metadata Model
- Press Create entity and create empty
reportNameCCentity. - Save but **DO NOT PUBLISH!**
- Open
Computed Contenttab and fill in:Input Attributes-- entities that are participating in the computation.Query-- templated SQL query that does computation.Computed Properties-- output properties to be used when this computed content entity would be embedded.
Input Attributes
Add 2 entities: report and reportColumn. Both should have required properties added too:

Aliases and names would be used in the query.
Query
Templated SQL query is not very user friendly but it gets the job done.
We want to have SQL that for every report extracts all report columns and adds reportName to them:
select
c.$cId$ as "id_i",
c.$cId$ as "parent_id_i",
r.$rFrom$ as "from_h",
$path(c.$cPath$)$ as "path_i",
$type()$ as "type_i",
r.$rName$ as "reportName" -- (1)
from $r$ r
inner join $c$ c on r.$rId$ = c.$cParentId$(1) Should be used as an output in Computed Properties

Computed Properties
We should add computed property and it is just a mapping to SQL column defined in SQL query above:

Now press Preview result to check if there is a data:

And if it is there publish the changes.
Apply Computed Content Column
- Goto Organization → Metadata Model.
- Find and edit
reportColumnentity. - Press Add property and add property as
Embedded objectwith typereportNameCC:
- Press Add property and add another property as
Delegated scalar property, setVia propertyto previously added computed content propertyreportNameCC, setDelegate propertytoreportName:
- Publish changes.

Now there is an "issue": I can see 2 report names when I open the report column:

We can hide computed column embedded property with layout change:
- Open web browser console (
Ctrl + Shift + Iin most browsers) - Execute
OpenDebuggingTools()javascript function (Or you can press :Ctrl + Shift + T):
- We can blacklist a property to hide it from this layout view. Edit the layout:
{
"_type": "entity.controller",
"children": {
"_type": "entity.page.detail",
"showViolations": true,
"children": {
"_type": "grid",
"items": [
{
"cols": 14,
"children": {
"_type": "entity.entity",
"children": [
{
"_type": "entity.property",
"name": "description"
},
{
"_type": "entity.card",
"title": "General information",
"children": {
"_type": "entity.property.rest",
"propertyTypes": ["S", "SRE"]
}
},
{
"_type": "entity.property.rest",
"propertyTypes": ["SEE", "AEE"],
"blacklist": ["reportNameCC"]
}
]
}
}
]
}
}
}Where
reportNameCCis a blacklisted property. -
Press
CTRL + S(orCMD + Son OSX) to save the layout.
The result is:

Unfortunately, there is no way to hide it from the right panel view:

Concatenate Attribute Values
- You have
reportentity. - It has
reportName,yearandtypestring properties.
The goal is to add reportFullName property to report which is a concatenation of type + reportName + year.

Computed Content Entity
- Goto Organization → Metadata Model
- Press Create entity and create empty
reportNameCCentity. - Save but **DO NOT PUBLISH!**
- Open
Computed Contenttab and fill in:Input Attributes-- entities that are participating in the computation.Query-- templated SQL query that does computation.Computed Properties-- output properties to be used when this computed content entity would be embedded.
Input Attributes
Add entity: report with required properties + properties that we would like to use for concatenation:

Aliases and names would be used in the query.
Query
SQL should just select everything and concatenate rType, rName and rYear:
.. code:: sql
select
r.$rId$ as "id_i",
r.$rId$ as "parent_id_i",
r.$rFrom$ as "from_h",
$path(r.$rPath$)$ as "path_i",
$type()$ as "type_i",
r.$rType$ || ' ' || r.$rName$ || ' ' || r.$rYear$ as "fullName" -- (1)
from $r$ r(1) Should be used as an output in Computed Properties

Computed Properties
We should add computed property and it is just a mapping to SQL column defined in SQL query above:

Now press Preview result to check if there is a data:

And if it is there, publish the changes.
Apply Computed Content Column
- Goto Organization → Metadata Model
- Find and edit
reportentity. - Press Add property and add property as
Embedded objectwith typereportFullNameCC:
- Press Add property and add another property as
Delegated scalar property, setVia propertyto previously added computed content propertyreportFullNameCC, setDelegate propertytofullName:
- Publish.

What if you would like to concatenate reference attribute?
Now imagine that instead of plain string there is an attribute with dropdown values -- brand -- and you want to add its value to the concatenation.

- Goto Organization → Metadata Model
- Find and open
reportFullNameCCentity. - Goto
Computed Contenttab and add another input entityBrand:
- Change the Query to

select
r.$rId$ as "id_i",
r.$rId$ as "parent_id_i",
r.$rFrom$ as "from_h",
$path(r.$rPath$)$ as "path_i",
$type()$ as "type_i",
b.$bName$ || ' ' || r.$rType$ || ' ' || r.$rName$ || ' ' || r.$rYear$ as "fullName" -- (1)
from $r$ r
left join $b$ b on b.$bId$ = r."brand_ri" -- (2)(1)Hereb.$bName$is added. Value from the joinedBrandentity.(2)Join condition is a simple one (although not obvious). You have to join referenced entity (Brand) by itsIdwith the main entity (Report) by the reference idbrand_ri. It would always be name of the reference attribute +_ri. -
Publish

OUTRO
That is it, not the easiest implementation one can wish for, but it gets the job done. 🤘🏽
