Why my import excel file is not working for web application?

Hi,

I am working on web application in which I need to import an excel sheet data into list. I tried to import the excel file to created entities in database but got following warning "Unable to import Excel file: Columns headers must be unique in "Form" worksheet." 

Please find sample attachment named Form.xlsx, the same structure of data table I want to create on a web screen in list importing data from it.

Kindly help.  

Hi Piyusha,

Outsystems cannot handle that type of Excel sheets out of the box.If you delete the first 2 rows first, it'll probably work.

If you really wish to import the sheet like it is, you can use a solution from the Forge, like Advanced Excel to import the Excel row by row.

Regards,
Lennart

Hi Piyusha, 


Lennart's right. The first two lines are not understood by OutSystems, as he said, if you eliminate them for sure it will work. Either way I leave you here the steps to import data from an excel.


Depends exactly on what you want to do... I will explain the three typical scenarios: 

  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.

Cheers,
Nuno Verdsca

Hi Lennart,

I have seen "Advanced Excel" plugin functionality and their server actions. It all describes operations on excel sheet. Here I need to create entities as that of excel sheet cell structure and that data shall be coming from API's. So further I need to show the data in same tabular format on web screen. 

Neither deleting upper two columns nor using "Advanced Excel" is a solution in this case. Please let me know how to implement above structure of excel data and map it using entities to list.


Thanks,

Piyusha 

Hi Nuno Verdsca,

I have seen "Advanced Excel" plugin functionality and their server actions. It all describes operations on excel sheet. Here I need to create entities as that of excel sheet cell structure and that data shall be coming from API's. So further I need to show the data in same tabular format on web screen. 

Neither deleting upper two columns nor using "Advanced Excel" is a solution in this case. Please let me know how to implement above structure of excel data and map it using entities to list.


Thanks,

Piyusha 

Hi Piyusha,

You can check the following article:


If you are starting a great place for you to see things happening is the online training. There's a video that discusses the bootstrap action, now we can't foresee every single example you'll bump into, but this video discusses how to change the bootstrap action to create realationships between entities by looking into the data in the excel file.


Finally here's an example you can probably get some good hints from.


Kind regards,

Nuno Verdasca

Hi Nuno Verdsca,

I checked the article but it is regarding Outsystems 10. I am working on Outsystems 11, so tried following steps but didn't find 'Create Action to Bootstrap data from an Excel' on right click of entity in data layer. 

This may not be the solution to my query. I can't find same steps to follow in Outsystems 11.

Kindly help.

Thanks,

Piyusha Dhalpe

Hi,

After this, choose your excel file, and the OutSystems Platform build everything that you need.

Cheers,
Nuno Verdasca

Hi Nuno Verdsca,

My query begins from their only. I did try that, after clicking on it I got following warning "Unable to import Excel file: Columns headers must be unique in "Form" worksheet". Kindly, go through my query above.

Kindly help.

Thanks,

Piyusha Dhalpe 

You use the excel-sheet  Merge property. You need to delete that row as OutSystems support only the Normal excel sheet with each column had a single header. Composite excel sheet will not import in OutSystems bootstrap excel. I am attaching the updated format. Please check it.

Thank you,

Sudip