How to extract filtered data from Edit Grid to Excel in UiPath Apps

How to extract filtered data from Edit Grid to Excel for UiPath Apps ? Since there is no direct way, has anyone done this ?

Hi @tilarapiyush

There’s no direct method to export filtered Edit Grid data to Excel in UiPath Apps.

Find below link,

Happy Automation!

There is no Data Source option in Text Box. Not sure how to proceed on this solution.

@tilarapiyush

What is mentioned above is not to use datasource in text box

Basically the filtering in edit grid is done via the search text box..but as the value of the search text box could not be extracted..we use a separate text box instead of search and add the expression to filter the grid and also at the same time the same expression can be used to send to process and save as excel

To send data to a process copyToDatatable is used.Hope this is clear

Cheers

Getting error on this.

@tilarapiyush

edit grid datasource will give full data again not filtered data..you need to filter it based on the text box and then pass the variable into edit grid and same filltered data directly can be used

cheers

Is it possible for user to select the filter criteria dynamically and that filter to be passed to process?

@tilarapiyush

Yes with the use of textbox the filter criteria would be dynamic only and based on the textbox

Cheers

Thanx for this clarification Anil. I was able to resolve this.
However, I am trying to download the filtered results by enabling a RPA process in background but when I use the same AND condition with 4 filters and any of the filter values comes in as blank (not filled in app output), no entity record is getting fetched.

How can I overcome this ?

1 Like

@tilarapiyush

glad you were able to resolve

Now coming to next one could you please elaborate or show some screenshots to understand it

cheers

I have 4 filters which user will update depending on their requirement. Somtime they may update 2 of these, sometimes 3 and so on. It has to be an AND condition. But when any of these field value is null (not filled by user), data service is not fetching any records.

However in Apps this is not he issue, filtering is happening ok even if some fileds are blank..

@tilarapiyush

thats because the input argument value would be empty…and as per filter it woukld check for blank value of that column

you might need to get the records and then filter instead of using filter in retrieved by checking which values are non empty records as you mentioned not always the filter would be present..

cheers

But over time there will be 1000s of records and it will create 1 issue. If user selects a record that is not in Top 1000 records of data Service, this logic will fail.

@tilarapiyush

why are you not passing the datatable directly from app?

and only the filters though?

cheers

Copytodatatable option is not working on the app.

@tilarapiyush

please check this

are you trying to get single row?or all the fitlered rows?..may i know the use case may be we can suggest how to acheive

also this is one way to convert listsource to datatable

MainPage.EditGrid.DataSource.data.Select(function(x) dt.LoadDataRow({x.Id,x.Email},False)).CopyToDataTable

here dt is a datatable variable which contains the strcuture of datatable needed..x.id and x.email are the values that are being added to dt

if you want a single row then use selecteditem instead of datasource

but ideally datasource gives full data..if you want filtered you can add where condition here to filter like a linq query

cheers

Image 1: This is how data is coming in from Data Service.

Image 2: This data I wish to export in Excel.

So basically all filtered rows I am trying to export.

@tilarapiyush

this is how you can do..a sample implementation

initialize a datatable on page load of main, chnage columns as needed

BuildDataTable(New DataTable(String.Empty), New DataColumn() { New DataColumn("Name", GetType(String)), New DataColumn("Email", GetType(String)), New DataColumn("Type", GetType(String)) }, New List(Of Object)().ToList())

use a button click event and then you can save the filtered data to datatable using set value

MainPage.EditGrid.DataSource.data.Select(function(x) dt.LoadDataRow({x.Email,x.Name,x.Type},False)).CopyToDataTable

hope this helps you understand how to send teh fitlered data as datatable directly to process

to show I took the count of datatable..it says 2 as two rows are present

cheers

What You Do in the App What Happens Behind the Scenes Example Use Case
Filter data in the Edit Grid App sends filtered data/criteria to backend Filter support tickets by status
Click “Export Filtered Data” Backend workflow processes the data Export sales leads by region
(Optional) Receive Excel file Workflow exports to Excel, sends to user Download or email report

So Tilarapiyush, while there’s no magic button for this yet, with a little setup, you can definitely export just the filtered data you need from UiPath Apps to Excel. It’s a practical workaround that’s helped plenty of teams get their jobs done!

This approach worked fine. I am able to export the data to excel now. Thanx for help. Just one observation, in case any of the column value is blank, that is not getting exported. Menas, that column itself is not getting exported to excel. Can we get that too ?