Report templatesFunctions

getByDomain

Filter and organize items by assessment domain with automatic ordering

Usage

The getByDomain function filters items by their assessment domain and returns them with sequential order IDs.

Syntax

{input | getByDomain:domain}

Parameters

  • input (object): An object containing items with assessment_domain property
  • domain (string): The domain to filter by

Returns

An object containing:

  • items: Array of filtered items, each with an added order_id property (starting from 1)
  • hasItems: Boolean indicating if any items were found

Examples

Basic domain filtering

{assessments | getByDomain:"Network"}
// Returns: {
//   items: [
//     { ...item1, order_id: 1 },
//     { ...item2, order_id: 2 }
//   ],
//   hasItems: true
// }

Check if domain has items

{findings | getByDomain:"Web Application" | get:"hasItems"}
// Returns: true or false

Get filtered items

{controls | getByDomain:"Physical Security" | get:"items"}
// Returns array of physical security controls with order_id

Empty result

{items | getByDomain:"NonExistent"}
// Returns: { items: [], hasItems: false }

Using in tables

{vulnerabilities | getByDomain:"Infrastructure" | get:"items"}
// Returns ordered list of infrastructure vulnerabilities

Use Cases

  • Organizing assessment findings by domain
  • Creating domain-specific report sections
  • Filtering security controls by category
  • Building ordered lists for specific domains
  • Conditional rendering based on domain presence

Special Features

  • Automatically adds sequential order_id to each filtered item
  • Preserves all original item properties
  • Provides boolean flag for easy conditional checks
  • Maintains order of items as they appear in the input object