Skip to main content
Question

How to create a column on the Terms overview page to display a referenced object array


Hello!

My org wants to create a new column on the Terms overview page to display items from a referenced object array. Specifically, we want to display Data Protection Classification information there on the overview page in a column. At first, we were told this was not possible, but we have seen this done on another one of our overview pages that displays Policies, which is also a referenced object array.

 

 

This was created for us, and the json from the β€œEdit Page” screen looks like it is inherited from another entity.

 

{
  "_type": "entity.page.listing",
  "children": {
    "_type": "entity.listing.v2"
  }
}

 

Here is what our current Terms overview page layout looks like:

 

 

And the JSON behind the layout:

 

{
  "_type": "entity.page.listing",
  "children": {
    "_type": "relationships.hierarchyListing",
    "enableSelection": true,
    "columns": {
      "type": {
        "dataPath": [],
        "name": "Type",
        "after": "name",
        "renderer": {
          "_type": "glossary.termType.tableCell"
        }
      }
    },
    "flatListingRenderer": {
      "_type": "entity.listing.v2",
      "renderers": {
        "_default": {
          "columns": {
            "name": {},
            "type": {
              "dataPath": [],
              "name": "Type",
              "renderer": {
                "_type": "glossary.termType.tableCell"
              }
            },
            "abbreviation": {},
            "dqEvalTermAggr": {
              "name": "Overall Quality",
              "extraFetchRules": [
                {
                  "pattern": "./dqEvalTermAggr/*"
                }
              ]
            },
            "stewardship": {
              "name": "Stewardship",
              "extraFetchRules": [
                {
                  "pattern": ".",
                  "entityVersionExtensions": [
                    "stewardship"
                  ]
                }
              ]
            },
            "description": {
              "name": "Definition",
              "dataPath": [
                "businessDefinition"
              ],
              "renderer": {
                "_type": "entity.richText.tableCell"
              },
              "extraFetchRules": [
                {
                  "pattern": "./businessDefinition"
                }
              ]
            }
          }
        }
      }
    }
  }
}

 

Any idea how to recreate that Policies column, but with the Data Protection Classification entity? 

 

Thank you!

Did this topic help you find an answer to your question?

3 replies

anna.spakova
Ataccamer
Forum|alt.badge.img+3

Hi,

 

could you try to add this to your JSON?

		  "dataProtectionClassification": { //name of the section, can be whatever
              "name": "Security Classification", //name that will be displayed as the column name
              "dataPath": [ //source data for the field
			       "dataProtectionClassifications", // name of the property in the term entity
			        "name" //name of the property inside the dataProtectionClassification object that stores the display name
			  ],
              "renderer": {
                "_type": "entity.scalar.tableCell"
              },
              "extraFetchRules": [
                {
                  "pattern": "./dataProtectionClassifications/*" //again the name of the property in the term
                }
              ]
            },

I don’t know how exactly are your objects called, so this is an example. // is my comment, so please remove those.

Please let me know if this helps.

Kind regards,

Anna


Hi ​@anna.spakova,

Thanks for the response! I could not quite get this to work. For more background information here is our metadata model for our term entity with the desired object highlighted by the red box:

Clicking into that property shows this object:

So, here is what I tried in the Layout, but could not get to work:

            "dataProtectionClassification": {
              "name": "Classification",
              "dataPath": [
                "dataProtectionClassification",
                "name"
              ],
              "renderer": {
                "_type": "entity.scalar.tableCell"
              },
              "extraFetchRules": [
                {
                  "pattern": "./dataProtectionClassification/*"
                }
              ]
            },

I’m sure I formatted something wrong, or made an error somewhere. Can you spot it here? 

Thanks again!


anna.spakova
Ataccamer
Forum|alt.badge.img+3

Hi ​@tyler manawes ,

thanks for the details! So you actually need to use the classifications instead of dataProtectionClassification. Please try this:

            "dataProtectionClassification": {
              "name": "Classification",
              "dataPath": [
                "classifications",
                "name"
              ],
              "renderer": {
                "_type": "entity.scalar.tableCell"
              },
              "extraFetchRules": [
                {
                  "pattern": "./classifications/*"
                }
              ]
            },

You need to use the name of the property array inside term entity, which is called classifications.

Please let me know if this helped!

Kind regards,

Anna


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings