Working with Data Grids
Data grids allow users to enter multiple rows of structured data.
Basic Data Grid Setup
To create a data grid:
- Add a Data Grid component to your form
- Configure columns by adding components to the grid
- Set minimum and maximum rows if needed
- Configure add/remove row button labels
Calculated Columns
Add calculated fields to data grids:
- Add a Number component to a data grid column
- Go to the API tab (Technical Properties)
- In the Calculated Value field, reference other columns in the same row using
row.columnKey
Example: Calculate row total:
value = row.quantity * row.price;
Summarizing Grid Data
Calculate totals or summaries from grid data:
- Add a calculated field outside the grid
- Reference grid data using
data.gridName - Use array methods to process the data
Example: Calculate sum of all row totals:
value = data.lineItems.reduce(function(sum, row) {
return sum + (parseFloat(row.total) || 0);
}, 0);
Example: Count rows that meet a condition:
value = data.employees.filter(function(row) {
return row.department === 'IT';
}).length;