Refresh Pivot Tables in the sheet

Hi,
I have 5 sheets in a workbook containing pivot table.
I am adding data in one of it and after adding it I need to refresh all the pivots in all the sheets.
Can anyone suggest how to do it?
Note:- I won’t be able to share the worksheet
Thanks in advance!!

Hi @Kunal_Jain

You can use the Refresh Pivot Table activity to refresh the pivots.
image

Hope it helps!!

Hi @mkankatala
But there are pivots in every sheet and I need a code to refresh the complete sheet at once.
Thanks!!

@Kunal_Jain

We can use refresh pivot activity to refresh all pivots at once as well ,…Excel.AllPivotTables

image

This will ensure all tables are refreshed

Hope this helps

cheers

Hi @Anil_G
I have ties this method but after refreshing the data is automatically getting deleted.

@Kunal_Jain

Data deletion is not part of this anyway…please check the flow and the data being provided

Cheers

Hi @Anil_G
No actually the data is getting deleted from pivot table means after refreshing it.

@Kunal_Jain

Then mostly then updated datasource is not proper…can you check the datasource once please

are you by any chance changing the datasource…becasue refresh will only refresh the data but not the datasource underlying it…if that is changed then we need to use change data source instead

cheers

Hi @Anil_G
Yes I am deleting the previously present data and adding the new data into the sheet.
Thanks!!

@Kunal_Jain

May be that is causing the issue…instead of delete and readd try to overwrite …as it might be changing the pivot data source…to check try checking the pivot datasource and see if it is changing

Cheers

Hi @Anil_G
Overwriting the data is helping me, but it is not completely giving me the solution.
Because in the previously present in the sheet there are records present say: 101 records are present with header.
And I have to paste new 70 records, so there are excess 30 records present in the end which is from the previously present data.
So how to resolve this issue?
Thanks in advance!!

@Kunal_Jain

Instead of delete rows…use clear data and check if that helps

else other way would be after pasting new data delete the old one

cheers

Hi @Anil_G
How to delete the data after pasting the new one?

@Kunal_Jain

  1. Count the number of rows that exists…then paste the data…
  2. Now get the difference between old row count and new row count
  3. Now use delete rows …with the row number as nee row count + 1

Cheers

Hi @Anil_G ,
can you please share one xaml file for deleting the data after pasting the new one.
It will be really helpful.

Thanks.

Hi @Anil_G
Can you help me with a xaml or code please.
It would be really helpful because I am a bit confused on how to delete extra rows if exist.
Thanks in advance!!

@Kunal_Jain @siddhi

Please try this

BlankProcess - Copy (9).zip (5.4 KB)

cheers

Hi @Anil_G
The process you shared seems to be different from an example image you shared.
Can you please share the same xaml please?
Thanks in advance.

@Kunal_Jain

Update.xaml is what you need to check

Cheers

@Anil_G

it is giving this error.

Thanks.