Links in module data

A module data value in the form [label](target) is displayed on the Root management dashboard as a link rather than as text. Linking is always deliberate: a value that merely happens to contain a URL is still displayed as plain text, so this syntax is the only way to produce a link.

Available once the module_data_links feature is enabled for your organization.

Links work wherever module data is displayed, and do not require the display data hooks. Any value written into module — by the quote hook, application hook, policy issue hook, or an alteration — is rendered the same way, as is a value returned in display_data by getPolicyModuleDisplayData() or getApplicationModuleDisplayData().

return {
  ...quote,
  module: {
    ...quote.module,
    previous_policy: '[View previous policy](root:policy:' + previousPolicyId + '#invoices)',
    broker_record: '[Open in broker portal](https://brokers.example.com/clients/48119)',
  },
};

Linking to another Root record

Internal links use the root: scheme:

root:<entity type>:<entity id>
Entity typeLinks to
policyA policy
policyholderA policyholder
claimA claim
applicationAn application
complaintA complaint

The link resolves within the organization the dashboard user is already viewing, so you never include an organization id. An entity id may contain letters, numbers, hyphens and underscores.

Leave the label empty to fall back to the entity id:

'[](' + root:claim:' + claim.claim_id + ')'   // renders as the claim id

Linking to a section of a policy

Add #<section> to a root:policy: link and the policy opens scrolled to that section:

'[View invoices](root:policy:' + policy.policy_id + '#invoices)'
SectionAvailable
summaryAlways
billingAlways — the policy's payment method
claimsAlways
complaintsAlways
beneficiariesAlways
documentsAlways
ledgerAlways
paymentsOrganizations on the original ledger table
couponsOrganizations on the original ledger table
refundsOrganizations on the original ledger table
invoicesOrganizations with invoicing enabled, for users with permission to read invoices
alteration-packagesOrganizations with the alteration package list enabled
covered-peopleProducts with covered people enabled

A section name must be lower case, and may contain numbers and hyphens.

A section that isn't available is not an error

If the section is switched off for the organization, hidden from that user, or simply misspelled, the link still works — it opens the policy at the top of the page and nothing else happens. There is no error and no warning, so it is worth checking the spelling against the table above.

Sections apply to root:policy: links only. A #section on a link to a policyholder, claim, application or complaint is ignored, and the link opens at the top of that record.

Linking to an external page

Any http:// or https:// address is used as-is and opens in a new tab:

'[Open in broker portal](https://brokers.example.com/clients/48119)'

The destination host is always shown next to the label — Open in broker portal (brokers.example.com) — so a label can never disguise where a link goes. Addresses using any other scheme are not linked.

When a value is not linked

The whole value must be the link. If it does not parse, it is displayed as ordinary text rather than as a broken link:

ValueResult
[Invoices](root:policy:abc123#invoices)Link
See [invoices](root:policy:abc123)Text — the link must be the entire value
[https://example.com](https://example.com)Text — no [label](...) around it
[Invoices](root:policy:abc123#Invoices)Text — section names are lower case
[Broker](ftp://files.example.com)Text — only http/https are linked
[Policy](root:contract:abc123)Text — unknown entity type

Did this page help you?