13
Views
3
Comments
Solved
(Advanced Excel) How to download Excel search results using DataGrid search criteria
Question
Application Type
Reactive

How to download Excel search results using DataGrid search criteria

Steps: Search by search criteria and Output the records displayed in the grid

AdExcel.oml
UserImage.jpg
Dilmi Amarasingha
Solution

I am able to download the Excel.
Instead of using the Outsystems DataGrid search section, use the Input widget and buttons to perform the search. 

Then output the search results to Excel.

2023-09-21 12-55-43
SIRAJKHILJI

Hi @Dilmi Amarasingha 

First of all, Outsystem datagrid gives by default export option when you click any row and after export, it returns only the search criteria result.



Do you need export functionality from outside the grid?

UserImage.jpg
Dilmi Amarasingha
Solution

I am able to download the Excel.
Instead of using the Outsystems DataGrid search section, use the Input widget and buttons to perform the search. 

Then output the search results to Excel.

2026-01-28 16-57-48
Mihai Melencu
Champion

Hi @Dilmi Amarasingha ,

I wouldn’t recommend using the Input widget, as it will always trigger a server-side refresh, which can significantly slow things down, especially with large datasets.

A simpler and more efficient approach is to use the Search function from the Data Grid. Here’s how you can implement it:

First, fetch the currently displayed data using the following JavaScript:

  • var grid = OutSystems.GridAPI.GridManager.GetGridById($parameters.GridWidgetId).provider;
  • var items = grid.collectionView.items;
  • var employList = items.map(function (row) { return row.Employ; });
  • $parameters.Json = JSON.stringify(employList);


Next, take the generated JSON and deserialize it into the structure you need. 

Finally, use the same Excel export action you already have, but pass in the filtered list instead of the full dataset. 

I attached an updated OML for you to check the implementation.


AdExcel_updated.oml
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.