Every fifteen minutes, your SCADA historian logs a reading. But when the biogas flow meter drops out from Friday night to Monday morning, it leaves 240 blank intervals just before Wednesday’s reporting deadline. Nobody fills 240 gaps by hand. Instead, an engineer calculates one defensible weekend figure, applies it across the outage, and files an email explaining why. The number is usually right, but the rationale is lost. No system checks if the method broke compliance rules or left credited volume on the table. Nine months later, an auditor picks one interval at random, asks for proof, and all you have is an email chain. It’s a classic operational trap - a quick, sensible fix that makes sense today, but leaves you exposed nine months later.

At Mangrove, our data rules and substitutions eliminate this vulnerability. In Part 1 of our Data Assurance series, we covered the review half: catching invalid readings before they ever reach a report. This post covers the corrective half: missing or anomalous data substitution.

When large or small data gaps occur and a reporting deadline looms, someone still has to produce a number, which usually happens in external spreadsheets. Mangrove moves that work directly inside the platform. As a compliance system for low-carbon fuel and carbon projects, Mangrove allows the same rule that flags a gap to automatically substitute it using a customized method approved by the producer and their program rules. Every change creates a complete record - logging the original missing value, the raw source data, and the calculated replacement.

What a substitution rule does: replace an invalid reading and keep the original

A data rule in Mangrove takes one of two actions when a reading is missing or invalid:

Both actions trigger on the same condition, but only the outcome changes. An alert simply highlights the issue, while a substitution imputes a replacement using your pre-approved logic.

Crucially, your original measured reading remains on record. The correction is stamped with the exact rule version that created it, allowing the original value to be reviewed or restored at any time. Downstream calculations automatically pull the new figure for future reporting, while auditors maintain full visibility into all three key details: the original value, the substituted value, and the underlying logic used.

The Then" step of a Mangrove data rule with the Substitute action selected and a list of substitution methods below it

Substitution methods: backup reading, forward fill, trailing average, prescribed default

A replacement comes from a substitution method—and you can queue more than one. Mangrove evaluates your methods in the exact order you set, applying the first one that successfully generates a value. Because compliance frameworks vary, a biogas project reporting renewable natural gas under the California Low Carbon Fuel Standard and a biochar project reporting carbon removals under Puro.earth will structure their fallback order differently. Some examples of data substitutions include:

Sequence dictates execution in this case. The first method to return a valid value wins. For instance, For example, a biogas operator might set a backup analyzer as Priority 1, fall back to a 7-day trailing average as Priority 2, and stop there. If no rule in the stack produces a valid number, the original interval remains untouched and the system escalates an alert for human review.

How a substituted value shows its lineage to an auditor

Mangrove clearly flags any datapoint modified by a rule, whether it’s an imputed figure, a gap-fill, or a reading restored to its original state. Raw, untouched measurements carry no mark. This allows the user or auditor to filter and review every substitution that was made across a reporting period in a single view.

Clicking into any substituted datapoint reveals both the current value and the raw original, along with a complete data lineage:

The evidence and data trail travels with the report. When you export the batch workbook for a reporting period, each measurement type receives a dedicated sheet. Auditors can inspect raw instrument logs side-by-side with the final calculated values and the exact rule version that generated the substitution.

Limits: what a substitution rule will not change

To ensure automated substitutions never compromise your reporting, Mangrove enforces four non-negotiable guardrails:

Creating substitution rules

Creating a substitution rule takes place in Project Settings, following the same intuitive process as standard alerts:

Before saving, Mangrove’s preview step lists every interval the new rule will impact. Once created, the rule automatically executes across all un-reported historical data within your specified date range, meaning a rule written this afternoon instantly cleans up the dataset for your upcoming reporting deadline.

Teams can also author substitution rules programmatically via the API or directly through an AI assistant using the Mangrove MCP server. Every correction, calculated output, and lineage record can be queried back through the same endpoints. For advanced logic, refer to our full Rule Expression Reference.

Why automated data substitution matters

Bringing data substitution inside Mangrove turns a fragmented, risky workaround into a defensible, single source of truth. When substitution logic lives in isolated spreadsheets and inbox archives, compliance relies on memory and manual labor. Moving that logic into the platform automates the heavy lifting while locking down data integrity. Operations teams save hours of stressful, deadline-driven manual entry, regulators get full transparency with an immutable audit trail, and project developers never lose revenue to guesswork or uncredited volume. By unifying detection, calculation, and lineage in one place, Mangrove transforms missing data from a costly audit liability into a seamless, fully compliant process.