Widget Core Function
UI Experience: Dropdown list for the userData Organization: Allows engineers to import Excel sheets into the calculator builder, providing access to complex external datasets.
Key Features
- Import Excel sheets directly into the calculator builder
- Store and access the row index of selected items
- Access entire rows of data once a user makes a selection
- Advanced filtering capabilities with custom filter functions
- Support for large, complex datasets
Video Tutorials
Uploading a Shared Table
Watch Tutorial
Learn how to upload Excel files as shared tables in the calculator builder
Shared Table Example
Watch Tutorial
See a complete example of shared table implementation
Visual Presentation
The shared table dropdown interface allows users to select from data imported from Excel files.
Configuration
Example Code
Configuration Parameters
Set to βlookupβ to define the widget type
Whether or not to enable the autosize function on the lookup. Will only work if the table has preferred sections possible
The name of the sharedTable to load for the lookup widget
Selector Object - Data to be displayed/checked in the member selector
Important Considerations
Excel File Format Requirements
Default Values
The βdefault valueβ for lookup tables are the βrow indexβ of the cell location (starting from 0).Data Filtering
When implementing filtering in the βLookup Data Filter Functionβ, consider the following: The result of thef(row) = function MUST be a boolean in the dataFilter equation. Think of the syntax with parentheses: f(row) = (row[n] == "Cell Value").
Key Points:
-
Single Function Definition: You canβt
andmultiplef(row)function definitions. It must be a single function definition. -
Row-by-Row Processing: The function runs on one row at a time, so the logic must reflect that fact. One row cannot equal βCell 1β AND βCell 2β simultaneously. You want an
orthere. - Array Column Limitation: Columns that include arrays cannot be considered in dataFilter functions.
Correct Filter Examples:
Examples from Current Calculators
| Reference ID | Calculator Link |
|---|---|
| lookup (concrete) | Steel Beam Calculator |
Development Workflow
JSON File Management
After finishing and reviewing the shared table and calculator:
- Upload the JSON file generated from the table (when uploaded to Calcs.com website)
- Save it to the
sharedTablesfolder within the Calcs.com folder on your computer - This ensures tests load correctly in Buildkite before submitting your PR
Best Practices
- Excel Format: Always follow established Excel formatting conventions from previous shared tables
- Testing: Test filtering functions thoroughly with various data combinations
- Performance: Consider the size of your shared table and its impact on load times
- Documentation: Include clear author notes explaining the data structure and any special filtering logic
- Version Control: Always include the JSON file in your repository for CI/CD compatibility