Table of Contents
Outline 2
Resources 2
Scenario 2
How-To 4
Create a Reactive Web App 4
Bootstrap an Entity and its Data from Excel 5
Create an Entity 8
Bootstrap Data into an Entity from Excel 10
1
Outline
In this exercise, we will focus on creating the first entities in OutSystems. To do so, we will
perform the following actions:
● Bootstrap an Entity and its data from an Excel file
● Create an Entity and its attributes
● Bootstrap data into an existing entity
Upon completion, we will end up with two entities and both will contain data that was
bootstrapped from Excel files.
Resources
This exercise has some resources that are needed to complete it, two Excel files and an icon:
● Employee.xlsx
● Departments.xlsx
● Data-Modeling-Exercise-Icon.png
These files can be found in the Resources folder of this lesson materials. The Excel files will be
used to bootstrap data to the Entities, while the icon is a suggestion to use when creating the
application. Despite being optional, all the steps assume the use of this icon.
Scenario
In this exercise, we’ll create two entities: Department and Employee.
We’ll start from an empty canvas, so the first step consists of creating a new Reactive Web App
and then add a B
lank m
odule. This blank module is where the entities will be defined.
After having the module created, using the Import New Entities from Excel… with the
Departments.xlsx file, the Department entity will be created and the data bootstrapped from
the Excel file and stored in the Entity.
2
The second entity (Employee) will be created manually with the following attributes
● Id (default)
● Name (mandatory)
● Email (mandatory and data type Email)
● JobTitle (length of 100 characters)
● IsManager (Boolean data type)
After creating the entity, its data from the Employees.xlsx file should be bootstrapped, using
the B
ootstrap Data from Excel action.
3
How-To
In this section, we’ll show you how to do this exercise, with a thorough step-by-step description.
If you already finished the exercise on your own, great! You don’t need to do it again. If
you didn’t finish the exercise, that’s fine! We are here to help you.
Create a Reactive Web App
1. Click the New Application icon.
2. Select Reactive Web App as the application type.
4
3. Set the application name to D
ata Modeling Exercise
4. Click the Upload Icon and then select the D
ata Modeling Exercise Icon.png icon from the
Resources folder.
5. Click the Create App button
6. Select Blank a
s module type, then click the C
reate Module button
Bootstrap an Entity and its Data from Excel
In this section, we will create our first Entity automatically from the Excel file Departments.xlsx.
1. Switch to the D
ata tab
5
2. Right-click the Database element, then select I mport Entities from Excel...
3. Locate the D
epartment.xlsx file from the exercise Resources, and open it
4. Click Import t o create the Entity and the bootstrap logic (Timer)
5. Publish the module to save the changes to the server
6
6. Right-click the Department e
ntity and choose View Data
7. The loaded data should be displayed:
7
Create an Entity
In this section, we will create the Employee Entity, and all its attributes, manually.
1. In the Data tab, right-click the Database element, then select A
dd Entity.
2. Set the Entity Name t o Employee.
3. Right-click the Employee entity, and select A
dd Entity Attribute.
4. Set the new attribute N
ame t o Name, and set it as mandatory.
8
5. Add another attribute named Email, and set it as mandatory.
6. Add another attribute named JobTitle with a L
ength of 100.
7. Add another attribute named IsManager with B
oolean Data Type.
8. Publish the module.
9
Bootstrap Data into an Entity from Excel
Finally, we have the Entity created, but with no data. Let’s use the Employees.xlsx file to
bootstrap some data to the Employee Entity.
1. Right-click the Employee Entity, then select A
dvanced > Create Action to Bootstrap
Data from Excel...
2. Locate the E
mployees.xlsx file and open it.
3. Validate that the four entity attributes were mapped to the four columns in the Excel file
10
4. Click Proceed.
5. Publish the module.
6. Right-click the Employee e
ntity then select V
iew Data.
7. The data from the Excel file should appear on the data previewer.
11