Data Apps
Was this helpful?
Was this helpful?
const result = await corral.runNamedQuery('revenue_by_location');
// result = { columns: ['location', 'revenue'], rows: [['Main St', '12450.00'], ...] }
// Rows are tuples — convert to objects before use
const data = result.rows.map(r =>
Object.fromEntries(result.columns.map((c, i) => [c, r[i]]))
);// Get current filter state
const bf = corral.getBoardFilters();
// bf.filterParams is an ARRAY: [{ name: 'location', value: 'main_street' }, ...]
// Find a filter value by name
const location = bf.filterParams.find(p => p.name === 'location')?.value;
// Re-render when filters change
corral.on('filtersChanged', () => {
// re-read filters and update the display
});