129
Views
3
Comments
Solved
[OutSystems Data Grid] Data Grid import from excel
outsystems-data-grid
Reactive icon
Forge asset by OutSystems

Hello,

How can I import Excel data from Button? for the data grid.

"Before clicking the button, the data grid should be empty; only after clicking the button, should data appear in the data grid."

2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi Thanos, 

In addition to the solution suggested by Mostafa, you will have to convert the excel record list data to JSON (with meta information) using the ArrangeData API action, available under the OutsystemsDataGrid module. Pass the generated json value as the Data source to DataGrid.

Your flow will look something like the below.

Demo Screen: DG_ImportXL

Refer to the attached oml

I hope this helps you!


Kind regards,

Benjith Sam

DG_ImportXLToGrid.oml
2020-11-25 10-45-32
Mostafa Othman
Champion

Hello Thanos,

You will need to create server action and use ExcelToRecordList widget which will convert excel to list of structure that you will create.

You need to create structure with attributes similar to ones existing into excel sheet.


You will need to pass record definition parameter to ExcelToRecordList widget which will be list of structure you created and pass excel file content may be from resources or from upload widget as per your implementation



After that you will pass the output of ExcelToRecordList (list of your structure) as source to your data grid

2022-12-09 04-50-17
Shubham Doshi

Hello,

1. Create a bootstrap action to fetch the data from excel

2. Call the bootstrap action in 'OnClick' event of button

2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi Thanos, 

In addition to the solution suggested by Mostafa, you will have to convert the excel record list data to JSON (with meta information) using the ArrangeData API action, available under the OutsystemsDataGrid module. Pass the generated json value as the Data source to DataGrid.

Your flow will look something like the below.

Demo Screen: DG_ImportXL

Refer to the attached oml

I hope this helps you!


Kind regards,

Benjith Sam

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