Hi team,
We’re currently using NocoBase to build an evaluation system with hierarchical data, and we’ve run into a limitation with the Template Print feature.
Our Data Model
We have a self-referencing structure in the tests collection:
-
A test can have sub-tests using a self-referencing field:
tests.parent_test_id → tests.id
Example:
-
Shooting (parent test)
- Accuracy (sub-test)
- Speed (sub-test)
Use Case (Template Print)
We are trying to generate printable reports (using Template Print) that show:
- Parent test (e.g., Shooting)
- Its sub-tests (Accuracy, Speed)
- Scores for each
Expected output structure:
Shooting: 21 / 30
- Accuracy: 12 / 15
- Speed: 9 / 15
Fitness: 18 / 20
Problem
In Template Print:
- Self-referencing relations (like
sub_testsorparent_test) are not visible in the field selector - Only direct fields and simple relations are shown
- There is no way to traverse or loop through hierarchical child records
This prevents us from:
- Rendering sub-tests under a parent test
- Building nested layouts in the print template
- Accessing child records dynamically
Observations
- Regular relations (e.g.,
belongsTo,hasMany) work fine when they are between different collections - However, self-referencing relations are not exposed in Template Print UI
- Even when the relation exists and is populated in data, it is not selectable
Expected Behavior
We expect Template Print to support:
-
Self-referencing relations in field list
- Example:
tests.sub_tests
- Example:
-
Nested rendering / iteration
- Ability to loop through child records inside a parent block
-
Multi-level traversal
- Parent → child → grandchild (if needed)
Impact
This limitation affects:
- Printable evaluation reports
- Score breakdown visibility
- Any hierarchical reporting use case
Request
Can you please confirm:
- Whether this is a known limitation?
- If there is a workaround?
- If support for self-referencing relations in Template Print is planned?
Happy to share sample schema or data if needed.
Nocobase Version - 2.0.17
Thanks!