← Reports Academy

Build the solution · 2 / 5

Ask for a clear run option

Let the person running the report choose whether a note appears.

YOUR TASK

Make this happen

3 steps
  1. Add the showNote BOOLEAN parameter with label Include handover note and default false; connect it through document parameters.

  2. Keep the working capabilities from the previous lesson and connect the new pieces to the same solution.

  3. Check the complete solution, then inspect any unmet requirements.

This step starts with the earlier solution and one new challenge. Each lesson keeps its own draft.

Read the starter files

main.cococo

report_document "weekly" {
  schemaVersion = 1
  snapshotRetentionDays = 30
  sources = [report_source.jobs]
  outputs = [report_output.csv]
}

source.cococo

report_source "jobs" {
  name = "jobs"
  kind = "MICRO_SQL"
  query = "SELECT jobs.name, jobs.status FROM jobs ORDER BY jobs.name ASC LIMIT 100"
}

outputs.cococo

report_output "csv" {
  name = "jobs.csv"
  format = "CSV"
  storage = "DATABASE"
  dataset = "jobs"
  columns = ["name", "status"]
}

parameters.cococo

report_parameter "show_note" {
  name = "showNote"
  label = "Include handover note"
  type = "BOOLEAN"
  # TODO: add required — see the task above.
  # TODO: add defaultValue — see the task above.
}

Reference: reports · getting-startedreports · sql-authoringreports · valuesreports · preparationreports · pdf-templatesreports · operationsreports · reference