Creating a Model from an Excel file 

Creating a Model from an Excel file 

  

I like to create a model from an Excel file.

I have for example the following Excel:

Sheet1: (name: Order)

Id
Name
1
Order1
2
Order2


Sheet2: (name: OrderLine)

Id
OrderId
Name
1
1
art1
2
1
art2
3
2
art1


When I import this Excel I get 2 not related tables with the Id renamed to Id2 and with a new Id added.

I know, I can remove the new Id and rename the Original Id back to Id, and than change the data type of OrderId to Order Identifier.

My question is: can I load this sheet so I don't have to do the manual corrections.

  1. Outsystems will not add a new Identifier
  2. Outsystems will automatically place the "Order Identifier" datatype to the OrderId column.

Regards,

Fred.






Hi Fred,

   if you would like to combine some keys between files you need to load the spreadsheet and put the combined registers by program.  Here is a video where you can see the general idea.

Luck

Hi Luciano,

I had already seen this Video. But this is not the solution. This is importing all the excel sheets and then removing and renaming the ids and create the relations manual.

I like to have an automated solution for importing multiple excel sheets with related data and transfer them to entities with relations. Outsystems can see the relations by the naming of the column headers.

Regards,

Fred.


Hi Fred,

    if you want to use the excel files only to do a "temporary transfer", only disregard the id created by Studio because you already have the id in the fields that will refer to the tables that will receive the data. 

Try to avoid names that have pattern behavior.  Every name that finishes with Id will be an identifier. The same for boolean that begins with Is or Enable.

Let me know if there are more doubts.

Luck

Hi Luciano,

I will do this action to create a datamodel from all the sheets in a excel file.

And the Pattern behavior is exactly what I want.

I want that if the first column in Excel is called "Id" outsystem don't create an extra Id. And that if a column is named "OrderId" it will be linked to "Order.Id".

Regards,

Fred.

 

 

Hi Fred,

   you need to understand how OS works.  Every table will have an Id and it is auto number by default. Every time you import an excel file a new number will be generated. So, you will not get to implement your logic because every row from excel will always have a new key.

If OS detects the id in your spreadsheet it will rename your field name and add the id with auto number because this is the pattern inside OS.

At least, this is what I understand.

Luck