Create Pivot Table activity does not trigger Excel’s automatic grouping

Hello.

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.

Can you please give me advice on this issue ?

the format of the table is set as Time and when I mannually crating pivot table, it will work.

@Nohat

instead of creating picot always have a template with pivot already created and fill the data in the template so that pivot refreshes

if you need to change the source you have change data source can leverage that..

cheers

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.

Hi @Nohat

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.

Happy Automation

Hi @Nohat

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.