Description
The Obsidian Dynamic Data block does not preserve its sorted row order when it creates the temporary EntitySet used by the Merge Template grid action.
This was reproduced on the official Rock demo with four stock people. The SQL query and displayed grid are ordered by LastName, NickName, and Id. The Merge Template page's Show Data Rows preview contains the same people in a different order before a merge template is selected.
The client builds the entity-set payload from grid.sortedRows and assigns each GridEntitySetItemBag an incrementing order:
https://github.com/SparkDevNetwork/Rock/blob/19.3.4/Rock.JavaScript.Obsidian/Framework/Core/Controls/grid.ts#L633-L768
GridHelper.CreateEntitySet() copies EntityId and AdditionalMergeValues but does not copy that order to EntitySetItem.Order:
https://github.com/SparkDevNetwork/Rock/blob/19.3.4/Rock/Obsidian/UI/GridHelper.cs#L58-L99
EntitySetService.GetEntityQuery() then orders by EntitySetItem.Order and falls back to Person ID:
https://github.com/SparkDevNetwork/Rock/blob/19.3.4/Rock/Model/Core/EntitySet/EntitySetService.cs#L123-L165
Since every persisted item order has its default value, the requested grid order is lost. The same omission is present on the current develop branch:
https://github.com/SparkDevNetwork/Rock/blob/develop/Rock/Obsidian/UI/GridHelper.cs
Suggested fix: Copy GridEntitySetItemBag.Order to EntitySetItem.Order in both branches of GridHelper.CreateEntitySet().
Dynamic Data grid (alphabetical order):
Actual Behavior
The visible Dynamic Data grid is ordered Alex, Cindy, Noah, and Ted Decker. After opening the Merge Template action, Show Data Rows changes the same records to Ted, Cindy, Noah, and Alex—Person ID order for these stock records. The SQL and visible grid order do not survive the Obsidian EntitySet handoff.
Merge preview (incorrect order):
Expected Behavior
The Merge Template page and generated document should preserve the row order supplied by grid.sortedRows. For this reproduction, the records should remain ordered by LastName, NickName, and Id: Alex, Cindy, Noah, then Ted Decker.
Steps to Reproduce
-
On the official demo site, add an Obsidian Dynamic Data block to a temporary internal page.
-
Configure the block for Grid output:
- Set the
Id column type to Person and hide it from the grid.
- Enable Person Report.
- Enable the Merge Template grid action.
-
Use this query:
SELECT p.Id, p.NickName, p.LastName
FROM [Person] AS p
WHERE p.Id IN (6, 7, 8, 9)
ORDER BY p.LastName, p.NickName, p.Id;
-
Load the page and confirm the visible order is Alex, Cindy, Noah, and Ted Decker.
-
Open the grid's ⋮ menu and select Merge Template.
-
Select Show Data Rows.
-
Observe that the preview order is Ted, Cindy, Noah, and Alex.
The reproduction made on 2026-08-26 used demo Page 906 / Block 1650. The public demo periodically resets, so those IDs may not remain available.
Issue Confirmation
Rock Version
19.3.4
Client Culture Setting
en-US
Description
The Obsidian Dynamic Data block does not preserve its sorted row order when it creates the temporary EntitySet used by the Merge Template grid action.
This was reproduced on the official Rock demo with four stock people. The SQL query and displayed grid are ordered by LastName, NickName, and Id. The Merge Template page's Show Data Rows preview contains the same people in a different order before a merge template is selected.
The client builds the entity-set payload from
grid.sortedRowsand assigns eachGridEntitySetItemBagan incrementing order:https://github.com/SparkDevNetwork/Rock/blob/19.3.4/Rock.JavaScript.Obsidian/Framework/Core/Controls/grid.ts#L633-L768
GridHelper.CreateEntitySet()copiesEntityIdandAdditionalMergeValuesbut does not copy that order toEntitySetItem.Order:https://github.com/SparkDevNetwork/Rock/blob/19.3.4/Rock/Obsidian/UI/GridHelper.cs#L58-L99
EntitySetService.GetEntityQuery()then orders byEntitySetItem.Orderand falls back to Person ID:https://github.com/SparkDevNetwork/Rock/blob/19.3.4/Rock/Model/Core/EntitySet/EntitySetService.cs#L123-L165
Since every persisted item order has its default value, the requested grid order is lost. The same omission is present on the current
developbranch:https://github.com/SparkDevNetwork/Rock/blob/develop/Rock/Obsidian/UI/GridHelper.cs
Suggested fix: Copy
GridEntitySetItemBag.OrdertoEntitySetItem.Orderin both branches ofGridHelper.CreateEntitySet().Dynamic Data grid (alphabetical order):
Actual Behavior
The visible Dynamic Data grid is ordered Alex, Cindy, Noah, and Ted Decker. After opening the Merge Template action, Show Data Rows changes the same records to Ted, Cindy, Noah, and Alex—Person ID order for these stock records. The SQL and visible grid order do not survive the Obsidian EntitySet handoff.
Merge preview (incorrect order):
Expected Behavior
The Merge Template page and generated document should preserve the row order supplied by
grid.sortedRows. For this reproduction, the records should remain ordered by LastName, NickName, and Id: Alex, Cindy, Noah, then Ted Decker.Steps to Reproduce
On the official demo site, add an Obsidian Dynamic Data block to a temporary internal page.
Configure the block for Grid output:
Idcolumn type to Person and hide it from the grid.Use this query:
Load the page and confirm the visible order is Alex, Cindy, Noah, and Ted Decker.
Open the grid's ⋮ menu and select Merge Template.
Select Show Data Rows.
Observe that the preview order is Ted, Cindy, Noah, and Alex.
The reproduction made on 2026-08-26 used demo Page 906 / Block 1650. The public demo periodically resets, so those IDs may not remain available.
Issue Confirmation
Rock Version
19.3.4
Client Culture Setting
en-US