Handling to-many results in a tabular format
You can select all assets from a domain together with their Note attributes. Each asset may have multiple notes. When there are multiple notes, the most recent note should be ordered at the top of the list.
The TableViewConfig may look similar to the example below.
{
"TableViewConfig": {
"Resources": {
"Asset": {
"Id": { "name": "assetId" },
"Signifier": { "name": "assetName" },
"StringAttribute": {
"LongExpression": { "name": "note" },
"CreatedOn": { "name": "noteCreatedOn" },
"Order": [ { "Field": { "name": "noteCreatedOn", "order": "DESC" } } ]
},
"Domain": {
"Id": { "name": "domainId" }
},
"Filter": { "Field": { "name": "domainId", "operator": "EQUALS", "value": "f342423f-54fd-4643-935b-adbd9e7f5e25" } },
"Order": [ { "Field": { "name": "assetName" } } ]
}
},
"Columns": [
{ "Column": { "fieldName": "assetId" } },
{ "Column": { "fieldName": "assetName" } },
{ "Column": { "fieldName": "note" } }
]
}
}Depending on the format requested, the results might be different. In Excel or CSV format, each asset is duplicated on a new row for each note value.

This is similar to using SQL queries to join two tables with a one-to-many relationship. Unlike SQL, if you select an asset with two notes and three responsibilities, the asset would use three lines of the Excel table, not six, and the third row in the note column would be empty.
JSON format, on the other hand, does not add duplicate rows to the results. Instead, it returns the first note found and discards the other notes.
"First note" is missing for "Business Asset 1"
For tabular formats that do not duplicate rows, you can add the Group mapping construct to the Columns section.
A Group mapping allows grouping multiple results for a single parent. A Group must receive a user-defined name that will be used when formatting the results.
Last updated
Was this helpful?