Hi @Tejashri Nevase,You can achieve this functionality in the current by extending either 'MS Excel' or 'MS Excel - Extended' VBO by creating a new action within the object.NOTE: I would recommend create a duplicate object of these objects and make your changes there so that you always have a backup with you in case anything goes wrong.Solution Explanation:Now, you need to create a new action in your already existing Excel VBO business object named 'Add Multiple Filters To Pivot Table Field' and provide the following input parameters to your action:Handle : This is a number type data item which will hold the current session dictionary value.Workbook : This is a text type data item where you need to pass the workbook name that you might get from 'Create Workbook' or 'Open Workbook' action.Worksheet: This is a text type data item which indicates the name of the worksheet in your excel workbook file where the pivot table exists.Column Number: This is a number type data item which indicates the column number in your original dataset from where you have created the Pivot table. The column number begins from 1 to N.Pivot Table Name : This is a text type data item which indicates the name of the Pivot Table.Criteria : This is a collection type data item which consists of a single column called as 'Criteria Name' of text data type and this column will consists of all the filter values that you need to have in your page filter in each individual row.Now, you can add a code stage named 'Add Multiple Filters To Pivot Table Field' and add the following inputs parameter and map the data items to it:Code:
Dim ws As Object
Dim lstAppliedFilters As List(Of String)
lstAppliedFilters = New List(Of String)()
ws = GetWorksheet(Handle, Workbook, Worksheet)
ws.Activate()
ws.PivotTables(Pivot_Table_Name).PivotFields(Column_Number).EnableMultiplePageItems = True
For Each criteriaItem In Criteria.Rows
For Each pivotFieldItem In ws.PivotTables(Pivot_Table_Name).PivotFields(Column_Number).PivotItems
If (Not criteriaItem(0).ToString.Equals(pivotFieldItem.Name)) Then
If (Not lstAppliedFilters.Contains(pivotFieldItem.Name)) Then
pivotFieldItem.Visible = False
End If
Else
If criteriaItem(0).ToString.Equals(pivotFieldItem.Name) Then
pivotFieldItem.Visible = True
lstAppliedFilters.Add(criteriaItem(0).ToString)
End If
End If
Next
Next
You should have your workflow ready as shown below:Testing For Solution:Now, publish your action and then use all the actions of the same business object where you have done the changes in your process studio while interacting with the excel file in order to avoid any exceptions. I have a sample process studio workflow shown below:So just to explain you a sample scenario which I have picked up, I basically have an excel file with below original table data:
I have also created a pivot table with the name, '
PivotTable1' before hand from start in a separate sheet called as '
Pivot' as shown below:
So what I want here is to add multiple filter values for the employee ID field (which is the column number: '1' in my original dataset) which would be 2,8 and 9 respectively. Hence, I am creating an excel instance, then opening my excel file, then making it visible on the screen and then I use my new created action which has the below parameters:
Post execution of the workflow I get the below results:
So here as you can see you can provide as many values as you want in different rows of your criteria collection with appropriate column number and pivot table name to have multiple filter criteria selected.
------------------------------
----------------------------------
Hope it helps you out and if my solution resolves your query, then please mark it as the 'Best Answer' so that the others members in the community having similar problem statement can track the answer easily in future
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
WonderBotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website:
https://devneet.github.io/Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
---------------------------------------------------------------------------------------------------------------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.