for each loops, you get the records in their original creation order—regardless of whether the subform uses drag-and-drop sorting or automatic column-based sorting.
| Sorting Method | What User Sees | What Deluge Sees | Result |
|---|---|---|---|
| Drag and Drop User drags Row 5 to position 1 |
Row 5 appears at the top of the subform | Row 5 is still in position 5 (creation order) | ✗ Custom order completely ignored |
| Predefined Column Subform set to sort by "Priority" (High to Low) |
Rows automatically displayed in priority order after save | Original creation order (Row 1, Row 2, Row 3...) | ✗ Automatic sorting not reflected |
| Either Method User clicks "Generate Report" button |
Expects report to match displayed order | Report generated in creation order | ✗ Output doesn't match user's view |
// SCENARIO: Task subform is configured to sort by "Priority" column (High to Low)
// This is automatic sorting - happens when record is created/updated
// User clicks a button to "Generate Prioritized Task List"
// What the developer writes:
for each task in input.Task_Subform
{
task_list = task_list + task.Task_Name + "\n";
}
// EXPECTED OUTPUT (what user sees on screen after save):
// 1. Fix critical bug (High)
// 2. Review code (High)
// 3. Update documentation (Medium)
// 4. Refactor old code (Low)
// ACTUAL OUTPUT (what Deluge produces):
// 1. Update documentation (Medium) ← Created first
// 2. Fix critical bug (High) ← Created second
// 3. Refactor old code (Low) ← Created third
// 4. Review code (High) ← Created fourth
// Result: User confusion and loss of trust in the system
// Note: The same problem occurs with drag-and-drop sorting!| Workaround Approach | Implementation | Problems | Status |
|---|---|---|---|
| Manual Sequence Field | Add a "Sequence" number field that users manually update |
- Requires users to manually type numbers - Defeats purpose of drag-and-drop sorting - Doesn't work with predefined column sorting - Prone to errors and gaps - Poor user experience |
✗ Not viable for real-world use |
| Sort in Deluge Instead | Use Deluge's .sort() function on subform collection |
- Only works if you know the predefined sort column - Cannot replicate custom drag-and-drop order at all - Assumes single-column sorting - Doesn't help if user needs multi-column sort - Still a workaround for what should be automatic |
⚠ Partial solution for predefined column only |
| JavaScript Widget | Build custom UI using JavaScript Widget instead of native form |
- Requires abandoning native form entirely - Must rebuild entire subform interface from scratch - Significant development and maintenance overhead - Loses all native form features and functionality - Defeats the purpose of using Creator's built-in forms |
✗ Not viable - abandons native functionality |
for each task in input.Task_Subform.sortBy("display_order")
{
// Process tasks in the order the user sees them
info task.Task_Name;
}sort_info = input.Task_Subform.getSortState();
// Returns:
// {"type": "predefined_column", "column": "Priority", "direction": "desc"}
// or {"type": "drag_and_drop"}
if(sort_info.get("type") == "drag_and_drop")
{
// Drag-and-drop enabled, access via display_order
sorted_tasks = input.Task_Subform.sortBy("display_order");
}
else if(sort_info.get("type") == "predefined_column")
{
// Predefined column sorting, replicate that sort
sorted_tasks = input.Task_Subform.sortBy(sort_info.get("column"), sort_info.get("direction"));
}
else
{
// No sorting configured, use creation order
sorted_tasks = input.Task_Subform;
}// System automatically maintains display_sequence field for both sorting methods
for each task in input.Task_Subform.sortBy("display_sequence")
{
// Always iterates in display order
// Works regardless of sorting method (predefined column or drag-and-drop)
info task.Task_Name;
}User Experience Impact: Whether using predefined column sorting (automatic) or drag-and-drop sorting (manual), when users see data in a particular order on screen and the system's automation ignores it, it creates frustration and erodes trust. Users expect that if they can see data in a certain order, the system should be able to work with it in that order.
Can this be addressed in a future update?
This is a fundamental disconnect between what users see in the UI and what developers can access in code. Both sorting methods (predefined column and drag-and-drop) suffer from this limitation. The current implementation forces developers to choose between:
|
1. Disable Sorting Remove sorting capabilities (both predefined column and drag-and-drop) to avoid user confusion when automation doesn't respect display order |
2. Accept Mismatch Allow users to sort but acknowledge that automation will produce unexpected results |
Neither option is acceptable for professional applications.
Community Input Requested: Has anyone else encountered this limitation or found a reliable workaround? This affects any application where subform ordering matters to end users.
Writer is a powerful online word processor, designed for collaborative work.