Import Excel Data to Record Table

Hi Folk,


I was trying with ExeclToRecordList for importing data to Record table. i am getting Exception "None of the column headers match with the record attributes." 


Please help on below issue.




Hi Ravi,

Its looks like excel columns not match with Outsystems Entity that you are trying to import.

Normally Outsystems read excel first rows as columns in Entity, which has to match both side the same name, and count of excel first row and entity columns

Can you verify the excel first row, and match with entity you are trying to insert.


Thanks,

Balu


In Excel all columns are same what i have created in Entity. 

In case someone is still having this problem:

I encountered the same error and did all of the recommendations I could find on the forums:

-> check if the columns in the Excel match the description of the structure attributes

-> check if the right sheet is selected

-> try deleting the excel to record list and implementing it again

...

I managed to fix it in the end by wrapping the excel to record list in a wrapper action, passing in the binary and having the record list as an output. not sure why this was needed, it seems like a bug. Worth noting: in my case, I was performing the excel to record list on a binary already stored in the database, not on an uploaded file.

Hello Ravi,


Check the Label property of the structure and compare if it is the same as the Name of the Header of the column in the excel.


Regards,

Ruben Rodrigues

Hi Ravi,

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.


Tell if this help you?

Best regards,
Nuno Verdasca


Another point, try use a logic flow like this:


Your Excel binary (from upload widget) should be put into File Content property.

You also need record definition, create structure that mimic your excel file columns.

Lastly, choose Sheet Name, or empty it for first sheet.


Cheeres,

Nuno Verdasca