Quantcast
Channel: OutSystems Community
Viewing all articles
Browse latest Browse all 1476385

[Academy] 1.1 Create an Entity from an Excel File

$
0
0
Hi Martin,

I took a look but didn't see anything strange.
Let me try to guide on what's happening behind the scenes so that you can overcome this issue.

When you select the excel file a mapping is done between the excel columns and the entity attributes. This mapping is done by name and a dialog shows this mapping. This is usually the first step that can go wrong, you have different names and the mapping leaves some information out. Apparently this is not your case.

This excel is stored as a resource in your module and some logic is created to read the excel rows and to put that information in the database. This logic consists of a Timer that executes an action when you publish the module.
The logic in the action itself is relatively simple:
  • Check if there's already data for that entity in the database, using an aggregate;
  • If not transform the excel content in a list of records (using an ExcelToRecordList) with data type set to a structure that was created with the columns that were mapped from the excel file;
  • Cycle throught the list and create records in the database.
Now if you already have data in the database the action stops right at the beggining to prevent from having duplicates every time you publish your module.

So, my suggestion is that you place some breakpoints in the bootstrap action. And use the debugger to go over this logic step by step and determine why your data is not being stored in the database.

Sorry for the long answer, I hope it helps.

Cheers

Viewing all articles
Browse latest Browse all 1476385

Trending Articles