Dynamic Lookup Widgets are a powerful tool for allowing users to select values from a predefined set of options that can change based on conditions or other inputs. This guide walks through setting up and using dynamic lookup widgets.
Setup Process
1. Creating the Options Data
1
Create a Equation Widget
Start by creating a equation widget or equation widget to store your options data
2
Structure Data as a Matrix
Organize your data in a matrix format, where each option set is separated into rowsExample format:
[[A,a], [B,b], [C,c]]
2. Setting Up the Dynamic Widget
1
Create the Dynamic Widget
Add a new dynamic lookup widget to your template
2
Link Data Source
In the data source field, input the ID of the equation widget you created in step 1. This ensures the dynamic widget pulls its options from the correct source
3. Setting the Default Value
1
Select Default Value
Decide on a default value that should be presented to the user initially
2
Use matrixSubset
Use
matrixSubset to select the first value from the matrix created in the equation widgetExample: matrixSubset(t_avail, 0, 0) selects the first element
This formula selects the first element from the t_avail matrix to be the default value.
4. Testing and Final Adjustments
1
Thorough Testing
Test the widget extensively to confirm that values are displayed correctly according to the conditions you’ve set
2
Hide Equation Widget
Hide the equation widget to prevent user confusion and ensure a clean user interface
3
Make Adjustments
If any issues are identified during testing, make necessary adjustments to formulas, connections, or settings
Data Structure Examples
Simple Options Matrix
Conditional Options Matrix
Common Use Cases
Material Selection
Different materials available based on design code or region
Section Properties
Available cross-sections filtered by material or size constraints
Load Factors
Load combination factors that vary by building type
Code Parameters
Design parameters that change based on selected standard
Best Practices
- Always provide a sensible default value using
matrixSubset - Hide the data source equation widget to keep the interface clean
- Test all possible conditions that affect the dropdown options
- Use descriptive labels for both display text and underlying values
- Consider performance impact with very large option sets
- Document the data structure in
authorNotesfor future developers
Ensure your data matrix structure is consistent across all conditions. Inconsistent matrix shapes can cause errors when the dynamic lookup widget tries to process the data.
Matrix Functions
Common Matrix Operations
matrixSubset(matrix, row, col)- Extract specific valuesmatrixLength(matrix)- Get number of rowsmatrixColumn(matrix, col)- Extract entire columnmatrixRow(matrix, row)- Extract entire row