Bug: Required Info fields export empty from Reports Hub

Objective

  • Fix Required Info field columns selected in Reports Hub exporting with no data in the downloaded file.
  • Ensure requiredInfoValues are correctly projected, resolved, and written to export rows for all export entity types that support Required Info columns.

Background

  • Catherine Lemoine (SE/Residential) reported that selecting Required Info fields in Reports Hub and running an export produces a file where those columns are blank or missing.
  • The export completes without error — the fields appear to be recognized by the UI but arrive empty in the CSV/XLSX output.
  • The export pipeline in attik-backend has a distinct path for Required Info columns: they are identified by a REQUIRED_INFO_VALUE_PREFIX on the column key, the backend adds requiredInfoValues to the MongoDB projection, and transformData resolves each cell by matching _requiredInfoId within the document's requiredInfoValues array.
  • Entity scope gap (hypothesis A): buildSingleEntityProjection only adds requiredInfoValues to the projection when targetEntity is inspections or quotes. If the export is run on any other entity, the field is silently absent from all fetched documents, producing empty cells with no error.
  • ID match failure (hypothesis B): If the column key prefix-stripping or _requiredInfoId comparison fails (e.g. ObjectId string vs. string type mismatch), entry is undefined and rawValue defaults to ''.
  • Missing requiredInfoValues on records (hypothesis C): Jobs predating when Required Info was introduced may not have the array populated.
  • The export entity Catherine was running is unknown — this is an open repro variable.

Product Decisions

Locked

  1. Required Info columns are currently supported only on inspections and quotes entity exports — this is intentional per buildSingleEntityProjection.

Open

  1. Entity scope — If Catherine was running a non-inspections/quotes export, is the correct fix to silently drop RI columns with a UI warning, block RI column selection for unsupported entities, or expand RI support to additional entities?
  2. Repro confirmation — Engineering needs to confirm which export entity and which specific Required Info fields Catherine had selected before fixing.

Scope

Backend (attik-backend / attik monorepo)

  • src/routes/dataExport.ts (apps/backend/src/routes/dataExport.ts) — route handler; buildSingleEntityProjection controls whether requiredInfoValues is added to the projection; getSingleEntityHeaderData calls getRequiredInfoLabels
  • src/util/functions/dataExports/documentResolution.tstransformData function; the Required Info cell resolution loop at column.startsWith(REQUIRED_INFO_VALUE_PREFIX); the _requiredInfoId match against doc.requiredInfoValues
  • src/util/functions/dataExports/filterBuilders.ts — defines REQUIRED_INFO_VALUE_PREFIX and SPECIAL_RULE_PATHS

Frontend (attik-frontend / attik monorepo)

  • src/app/tools/data-exports/CreateReportForm.tsx (apps/frontend/src/app/tools/data-exports/CreateReportForm.tsx) — column selection UI; how RI fields are added to the columns payload sent to the backend
  • src/app/tools/data-exports/constants.ts (apps/frontend/src/app/tools/data-exports/constants.ts) — column key construction; confirm REQUIRED_INFO_VALUE_PREFIX is correctly applied when building the payload

References

  • ATT-1850 — Preserve historical required-info values when fields or options are deleted
  • ATT-1938 — Show required-info as distinct worklist columns with blank visibility

Please authenticate to join the conversation.

Upvoters
Status

Triage

Board
🏠

Main App

Date

About 6 hours ago

Author

Linear

Subscribe to post

Get notified by email when there are changes.