> ## Documentation Index
> Fetch the complete documentation index at: https://learn.nextedy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Clickable Links

> Turn plain-text URLs and field values into clickable hyperlinks in Nextedy RISKSHEET cells using the `serverRender` column property.

export const LastReviewed = ({date}) => {
  if (!date) return null;
  const formatted = new Date(`${date}T00:00:00Z`).toLocaleDateString("en-US", {
    year: "numeric",
    month: "long",
    day: "numeric",
    timeZone: "UTC"
  });
  return <p className="mt-10 text-sm text-gray-400 dark:text-zinc-500 not-prose">
      Last reviewed on {formatted}
    </p>;
};

## Prerequisites

* Administrator access to edit sheet configuration
* Familiarity with [basic column configuration](/risksheet/guides/columns/add-basic-column)

## Approach Overview

Risksheet provides three approaches for making content clickable in grid cells. Choose the one that fits your use case:

| Approach                  | Configuration                                        | Editable       | Best For                                      |
| ------------------------- | ---------------------------------------------------- | -------------- | --------------------------------------------- |
| Rich text field rendering | `serverRender` with `.render().htmlFor().forFrame()` | No (read-only) | Fields that already contain HTML links        |
| Custom redirect link      | `serverRender` with HTML `<a>` tag                   | No (read-only) | Navigating to Polarion pages or external URLs |
| Context menu navigation   | No configuration needed                              | N/A            | Quick access to linked work items             |

<Frame>
  <img src="https://mintcdn.com/none-17b4493f/-Icoak49xQVOW38R/risksheet/diagrams/guides/columns/clickable-links/diagram-1.svg?fit=max&auto=format&n=-Icoak49xQVOW38R&q=85&s=5171ebf1cc522dbc696071058df2b673" alt="diagram" style={{ maxWidth: "600px", width: "100%" }} width="600" height="310" data-path="risksheet/diagrams/guides/columns/clickable-links/diagram-1.svg" />
</Frame>

## Render Rich Text Field Links

If the work item field contains rich text with embedded hyperlinks (for example, a description field with `<a href="...">` tags), use the Velocity rendering API to preserve the HTML and make links clickable:

```yaml theme={null}
columns:
- id: richDescription
  header: Description
  serverRender: $item.fields().description().render().htmlFor().forFrame()
```

This renders the full HTML content of the `description` field, including clickable links, bold/italic formatting, lists, and embedded images. The `.htmlFor().forFrame()` method chain ensures the content is rendered safely within the Risksheet grid frame.

For other rich text fields (not `description`), use the generic `get()` method with the field ID:

```yaml theme={null}
columns:
- id: customRichField
  header: Notes
  serverRender: $item.fields().get('notes').render().htmlFor().forFrame()
```

<Warning title="Server-Rendered Columns Are Always Read-Only">
  When you set `serverRender` on a column, the column automatically becomes `type: "text"` and `readOnly: true`. Users cannot edit the field content directly in the grid. Editing must be done through the Polarion work item editor. This protects the underlying rich text formatting from being stripped during cell editing.
</Warning>

## Construct Custom Redirect Links

To create a clickable link that navigates to a specific Polarion page or external URL based on a field value, construct an HTML anchor tag in the Velocity script.

### Link to a Polarion Wiki Page

```yaml theme={null}
columns:
- id: detailLink
  header: Details
  serverRender: <a href='/polarion/redirect/project/$item.getProjectId()/wiki/DetailPage/$item.fields().get('customField').get()'
    target='_blank'>View Details</a>
```

### Link to an External URL from a Field Value

If the work item stores a URL in a custom field, render it as a clickable link with a null-check to handle empty values:

```yaml theme={null}
columns:
- id: externalLink
  header: External Reference
  serverRender: '#set($url = $item.fields().get(''externalUrl'').get())#if($url)<a
    href=''$url'' target=''_blank''>$url</a>#else-#end'
```

This Velocity expression checks whether the `externalUrl` field has a value. If the field is populated, it renders a clickable link. If the field is empty, it displays a dash placeholder.

### Link to Another Work Item by ID

To create a link that opens a related work item in Polarion:

```yaml theme={null}
columns:
- id: relatedItemLink
  header: Related Item
  serverRender: '#set($ref = $item.fields().get(''relatedItemId'').get())#if($ref)<a
    href=''/polarion/redirect/project/$item.getProjectId()/workitem?id=$ref'' target=''_blank''>$ref</a>#else-#end'
```

<Tip title="Use `target='_blank'` for External Navigation">
  Always add `target='_blank'` to anchor tags in `serverRender` expressions. This opens the link in a new browser tab, keeping the Risksheet page intact. Without this attribute, clicking the link navigates away from the current page.
</Tip>

## Advanced: Conditional Link Rendering

You can combine Velocity conditionals with link rendering to display different content based on field values:

```yaml theme={null}
columns:
- id: statusLink
  header: Review Link
  serverRender: '#set($status = $item.getStatus().getId())#if($status == ''reviewed'')<a
    href=''/polarion/redirect/project/$item.getProjectId()/workitem?id=$item.getId()''
    target=''_blank'' style=''color:green''>Reviewed</a>#elseif($status == ''draft'')<span
    style=''color:gray''>Draft</span>#else<a href=''/polarion/redirect/project/$item.getProjectId()/workitem?id=$item.getId()''
    target=''_blank'' style=''color:orange''>Pending</a>#end'
```

This renders different link styles depending on the work item status — green for reviewed items, gray text (no link) for drafts, and orange for items pending review.

## Context Menu Navigation (No Configuration Needed)

Even without `serverRender` configuration, users can navigate to linked items using the right-click context menu on any grid cell:

| Menu Option          | Available When                                               | Action                                                                           |
| -------------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------------- |
| **Open Row Item**    | Always available                                             | Opens the current row's work item in the Polarion item editor                    |
| **Open Linked Item** | Cell contains a valid item link (not a new unsaved `*` item) | Opens the linked work item; label derived from level definition or column header |
| **Open Task Item**   | Cell contains a task link                                    | Opens the task work item; label uses `dataTypes.task.name` if configured         |

These context menu options require no `serverRender` configuration and work with standard `itemLink`, `multiItemLink`, and `taskLink` column types.

## Export Behavior for Server-Rendered Columns

Server-rendered columns export differently from standard editable columns. Be aware of these differences when users export to Excel or PDF:

| Export Format | Behavior                                                                                                                                                                |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Excel**     | HTML content is stripped to plain text. List structures (`<li>` elements) are converted to newline-separated text. Anchor tags are removed, leaving only the link text. |
| **PDF**       | HTML content is converted to plain text. Clickable links are not preserved in the PDF output.                                                                           |

<Warning title="Link Column Binding Validation">
  If you see the warning "Invalid column config, itemLink bindings without dot" in the server logs, your `itemLink` column binding is missing a dot-separated property path (for example, `bindings: "requirement"` instead of `bindings: "requirement.id"`). Ensure `itemLink` bindings use the correct `field.property` format.
</Warning>

For more control over export formatting, see [Export to Excel](/risksheet/guides/export/excel-export) and [Customize PDF Export Scripts](/risksheet/guides/export/pdf-custom-scripts).

## Troubleshooting

**Links are not clickable** -- Verify the Velocity expression produces valid HTML anchor tags. Open browser developer tools (F12), inspect the cell element, and check whether the rendered output contains `<a href="...">` tags. If the cell shows plain text instead of a link, the `serverRender` expression may have a syntax error.

**Column shows raw Velocity syntax instead of rendered content** -- This indicates a Velocity parsing error. Common causes include:

* Missing `#end` for `#if` or `#foreach` blocks
* Unclosed string literals (mismatched quotes)
* Incorrect variable references (variables must start with `$`)
* Field name mismatch (the field ID in `get('fieldName')` does not exist on the work item type)

**Duplicate item link error** -- If you see "This item is already linked to selected row" when using `itemLink` or `multiItemLink` columns, the work item you are trying to link is already associated with the current row. The editor enforces uniqueness to prevent duplicate references.

<Tip title="Test Server Render Scripts in Development First">
  Velocity API methods can vary across Polarion versions. Test `serverRender` scripts in a development or sandbox environment before deploying to production Risksheet documents. Use the Polarion developer tools or a test document to verify the output.
</Tip>

## Verification

After saving your sheet configuration changes:

1. Reload the Risksheet page in your browser
2. Locate the column you configured with `serverRender`
3. You should now see clickable links in the configured column — the text should appear as blue underlined hyperlinks
4. Click a link to confirm it opens the correct target in a new browser tab
5. Right-click a different cell and verify the context menu shows "Open Row Item" as expected

## See Also

* [Render Custom Data](/risksheet/guides/columns/custom-data-rendering) -- comprehensive server render patterns
* [Customize Link Rendering](/risksheet/guides/columns/custom-link-rendering) -- control how linked item references display
* [Work with Rich Text Fields](/risksheet/guides/columns/rich-text-fields) -- rich text field handling in the grid
* [Consolidate Multiple Link Columns](/risksheet/guides/columns/consolidate-link-columns) -- combining link columns into one
* [Configure Upstream Traceability Columns](/risksheet/guides/columns/upstream-traceability) -- upstream link configuration
* [Show Multiple Linked Items](/risksheet/guides/columns/multiple-linked-items) -- displaying multiple references per cell

<LastReviewed date="2026-06-24" />
