I am planning to automate creating pivot table task through RPA.
When a pivot table is created through UiPath,
Excel’s built-in auto-grouping feature may not run due to the way the pivot is generated.
As a result, the Hours grouping is not created in the Rows area.
To fix it, you must explicitly group the field using VBA/Invoke Code, for example:
PivotTable.PivotFields(“Time”).Group Start:=True, End:=True, By:=1 (for Hours).
So the solution is to create the pivot with UiPath, then run a small VBA script to force the Time field to group by Hour.
Try to create a template and copy that template and fill the data as per your requirment then refresh pivo. UiPath does not trigger auto‑grouping when creating pivot tables, so you need to explicitly add a Group Field step or use Excel macros/VBA to group the time column into hours after the pivot is generated.
Create pivot one in a pivot template like in sheet2, then paste or load new data into the data sheet(sheet1), Refresh the pivot
In-case the source range changes, update the pivot data source in UiPath
In this way, the grouping stays intact and you can use automation too.