Create a Basic Query Factory
Open the Configuration Editor for your RISKSHEET document
Navigate to the Query Factories section
Add a new query factory definition:
"queryFactories" : {
"filterBySoE" : {
"description" : "Filter Hazardous Situations by selected System of Equipment" ,
"query" : "linkedWorkItems.id:{{soeColumn}}"
}
}
Reference the query factory in your column configuration:
"columns" : [
{
"id" : "hazSituation" ,
"header" : "Hazardous Situation" ,
"dataType" : "itemLink" ,
"binding" : "hazardousSituation" ,
"itemType" : "hazard" ,
"queryFactory" : "filterBySoE"
}
]
Save the configuration and reload the RISKSHEET
Query factories support {{columnId}} placeholders that are replaced with the current row’s value for that column at runtime. This enables dynamic filtering based on user selections.
Implement Dependent Link Filtering
Create a two-column dependency where selecting a parent item filters available child items:
"columns" : [
{
"id" : "systemOfEquipment" ,
"header" : "System of Equipment" ,
"dataType" : "itemLink" ,
"binding" : "soe" ,
"itemType" : "system"
},
{
"id" : "hazSituation" ,
"header" : "Hazardous Situation" ,
"dataType" : "itemLink" ,
"binding" : "hazardousSituation" ,
"itemType" : "hazard" ,
"queryFactory" : "filterBySoE" ,
"canCreate" : false
}
],
"queryFactories" : {
"filterBySoE" : {
"query" : "linkedWorkItems.id:{{systemOfEquipment}} AND type:hazard"
}
}
Query Factory Data Flow
Disable Item Creation in Filtered Columns
When using query factories, you typically want to prevent users from creating new items that might violate the filter:
{
"id" : "filteredColumn" ,
"dataType" : "itemLink" ,
"queryFactory" : "myFilter" ,
"canCreate" : false
}
Setting canCreate: false removes the ‘Add new item’ option from the autocomplete dropdown.
Advanced Pattern: Multi-Level Filtering
Chain multiple dependent columns for hierarchical filtering:
"columns" : [
{
"id" : "productLine" ,
"header" : "Product Line" ,
"dataType" : "enum" ,
"binding" : "productLine"
},
{
"id" : "systemOfEquipment" ,
"header" : "System" ,
"dataType" : "itemLink" ,
"binding" : "soe" ,
"itemType" : "system" ,
"queryFactory" : "filterByProductLine" ,
"canCreate" : false
},
{
"id" : "hazSituation" ,
"header" : "Hazard" ,
"dataType" : "itemLink" ,
"binding" : "hazard" ,
"itemType" : "hazard" ,
"queryFactory" : "filterBySystem" ,
"canCreate" : false
}
],
"queryFactories" : {
"filterByProductLine" : {
"query" : "customFields.productLine:{{productLine}}"
},
"filterBySystem" : {
"query" : "linkedWorkItems.id:{{systemOfEquipment}}"
}
}
This creates a three-level hierarchy: Product Line → System → Hazard, where each selection filters the next column.
If the parent column value is empty or null, the query factory placeholder will be replaced with an empty string, potentially causing the autocomplete to show all items. Consider adding validation or user guidance to ensure parent columns are populated first.
Query factories execute on every autocomplete request. Complex queries or queries against large datasets may impact autocomplete response time. Test performance with realistic data volumes.
Common Use Cases
Use Case Query Factory Pattern Example Filter by upstream link linkedWorkItems.id:{{parentColumn}}Show mitigations linked to selected risk Filter by custom field match customFields.fieldName:{{columnId}}Show items with matching category Filter by type and relationship type:hazard AND linkedWorkItems.id:{{soe}}Show hazards for selected system Cross-project filtering project:{{projectColumn}} AND type:requirementShow requirements from selected project
Verification
After configuring your query factory:
Open a cell in the column using the query factory
Select a value in the parent/dependency column
Click into the filtered column
Start typing to trigger autocomplete
You should now see only autocomplete suggestions that match the current row’s context based on your query factory filter.
See Also
Support Tickets Source Code
AppConfig.ts
MultiItemLinkEditor.ts
TextEditor.ts
CellEditorFormatter.ts
QueryBuilder.java