JavaScript · Track 6 · Tutorial 2 of 2

Read a dataset back

Read back the operational data BrizoConsol holds: find your dataset, then read any month from it.

You will needThe headcount from Send operational data.
By the endA script that finds a dataset by name and reads its figures for a month.

1Find the dataset, then read it

Datasets are read by ID, so first list the company's datasets and find yours by its name.

Two calls: find the dataset, then read it
Reading operational data takes two calls: find the dataset's ID, then read it for a month.

2Write the script

Create read-operational.mjs:

read-operational.mjs

// read-operational.mjs - finds the headcount dataset and reads September from it.
import { call, companyId } from './brizo.mjs';

const datasets = (await call('GET', `/organisations/${companyId}/operation-data`)).body.data;

let headcount = null;
for (const dataset of datasets) {
    console.log(`Dataset ${dataset.id}: ${dataset.name}`);
    if (dataset.name === 'API: headcount') {
        headcount = dataset;
    }
}
if (headcount === null) {
    console.log('No headcount dataset yet - run operational.mjs first.');
    process.exit(1);
}

const answer = (await call('GET', `/organisations/${companyId}/operation-data/${headcount.id}?period=2026-09`)).body;
console.log(`${answer.dataset_name}, ${answer.period}:`);
for (const row of answer.rows) {
    console.log(`  ${row.dimension}: ${row.value}`);
}

3Run it

node read-operational.mjs

Check

Dataset 7: API: headcount
API: headcount, 2026-09:
  Sales: 12
  Operations: 8
  Finance: 3

Every dataset the company has is listed - including ones uploaded on screen - then September's rows from yours.

The first dimension reads back as dimension
One naming difference: the first dimension is sent as dimension_1 and read back as dimension.

4Narrow it down

Add &scenario=Budget for another scenario, or &dimension=Sales for one value of the first dimension. The month is required, as YYYY-MM.

Want more detail? See the documentation