Import Excel file and Update my Table Records

Import Excel file and Update my Table Records

  

Hey everyone,


I'm a beginner OutSystem developer and recently I have to make a Web Application with the functionality of importing data from Excel file. 

I would like to know how can I  import with a button a table from a sheet in a Excel file. I know it can be done with OutSystems. It's hard to search in the internet for a simple solution. Normally I find myself looking to a .xif file with no directions and/or facing problem using those files.


Can anyone expert help me?


Best regards,

MB

Solution

Hi Miguel,

Depends exactly on what you want to do... I will explain the three typical scenarios, although yours seems to be the last one: 

  1. If your Excel data has no equivalent representation in OutSystems then you can go to the Data tab in Service Studio, right-click on Entities->Database and select "Import Entities from Excel...". This will create a new entity (or entities) that map to the Sheet(s) you have on your Excel file, and will use the info on the Excel file to bootstrap those entities with data.
  2. If you already have the entities and just want to bootstrap data, you can go to the Data tab in Service Studio, right-click on your Entity definition and select Advanced->"Create Action to Bootstrap Data from Excel...". This will create an Action and associated Timer to bootstrap those entities with data from the Excel file.
  3. If you want to dynamically import data when clicking on a button, I'd suggest:
    1. using the Popup_Upload RichWidgets web screen (as the target of a Popup_Editor) to get the Excel file, and then
    2. in the Notify action use the Excel To Record List tool to transform an Excel sheet into a list of Structure instances and process it.

A shortcut to implement the 3. scenario logic is to follow the instructions on the 2. scenario to let the platform generate the bootstrap action and any required structures and then remove the generated timer and the Excel file in the Data->Resources folder, and adapt the generated action to perform the import and any extra logic required in 3.2.


Solution

Jorge Martins wrote:

Hi Miguel,

Depends exactly on what you want to do... I will explain the three typical scenarios, although yours seems to be the last one: 

  1. If your Excel data has no equivalent representation in OutSystems then you can go to the Data tab in Service Studio, right-click on Entities->Database and select "Import Entities from Excel...". This will create a new entity (or entities) that map to the Sheet(s) you have on your Excel file, and will use the info on the Excel file to bootstrap those entities with data.
  2. If you already have the entities and just want to bootstrap data, you can go to the Data tab in Service Studio, right-click on your Entity definition and select Advanced->"Create Action to Bootstrap Data from Excel...". This will create an Action and associated Timer to bootstrap those entities with data from the Excel file.
  3. If you want to dynamically import data when clicking on a button, I'd suggest:
    1. using the Popup_Upload RichWidgets web screen (as the target of a Popup_Editor) to get the Excel file, and then
    2. in the Notify action use the Excel To Record List tool to transform an Excel sheet into a list of Structure instances and process it.

A shortcut to implement the 3. scenario logic is to follow the instructions on the 2. scenario to let the platform generate the bootstrap action and any required structures and then remove the generated timer and the Excel file in the Data->Resources folder, and adapt the generated action to perform the import and any extra logic required in 3.2.



Hey there,


I've just solved the problem using a similar method from this post:

https://www.outsystems.com/forums/discussion/9384/importing-data-from-excel-help-users/

I would like to thank you for your time to answer my question.


Regards,

MB