How to download Excel search results using DataGrid search criteria
Steps: Search by search criteria and Output the records displayed in the grid
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.
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?
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:
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.