Render column with custom data

Modified on Fri, 29 Aug at 1:28 PM

In certain cases, you may need to display more complex or relational data within your Risksheet—such as showing Requirements linked to specific Mitigation Tasks. This goes beyond simple field bindings and requires rendering information that is dynamically gathered and processed.


To achieve this, you can add a custom column to your Risksheet that uses server-side rendering. This is done by embedding a Velocity script directly within the column definition. The script runs on the server and prepares the content before it is rendered in the UI, allowing you to pull and format data (e.g., related Work Items) as needed.


This approach is especially useful when:

  • You need to display linked or nested items

  • You want to format the output (e.g., as a list)

  • The data cannot be retrieved with simple field bindings alone




TABLE OF CONTENTS


Configuration


This can be done with a special column, with content being prepared on the server with an embedded Velocity script.


Take a look at the "serverRender" property.

{
            "headerGroup":"Mitigations",
            "headerGroupCss":"headMitigations",
            "headerCss":"headMitigations",
            "header": "Requirements",
            "bindings": "task.$item",
            "width": 170    ,
            "serverRender": "<ul style='margin-block-start: -16px;margin-block-end: -16px;padding-inline-start: 16px;'>#foreach($l in $item.fields().linkedWorkItems().back()) #set($r = $l.fields().workItem().get()) #set($t = $r.fields().type().get().id()) #if($t.equals(\"requirement\")) <li> $r.render().withTitle().withIcon(false).withLinks().htmlFor().forFrame() ($r.fields().description().render().htmlFor().forFrame()) </li>  #end #end</ul>"
                      
        },


The primary access point within a Risksheet rendering script is the $item variable. By default, $item refers to the row-level item, typically a Risk.


However, you can instruct the system to treat a linked item (rather than the row item) as the $item context. This is done by modifying the bindings property of the column:


For downstream objects, use:

"bindings": "task.$item"

OR

"bindings": "$DOWNSTREAM_OBJECT_ID.item"


For upstream objects, for example use:

"bindings": "harm.$item"


This approach lets you directly work with linked items in your Velocity scripts, enabling richer and more flexible data rendering within your Risksheet.


For any assistance, please don’t hesitate to reach out by submitting a ticket here.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article