in this lesson we'll start with a new web application to manage contacts
this application will store the contacts in the database
and we're going to call it phone book
let's then create the new application - phone book
and let's last change the icon of the application
select the icon here you'll find this icon
in the lesson resources as well as all the
files that we're going to use in this lesson. Let's create the application
and now we need to create a module for
our application. Unlike to blank module we used in the previous lesson
we're going to use this responsive module because this module has
a UI template by default there is prepared to work on desktop
and mobile devices, like tablets and smartphones
so let's go ahead and create the module. And you will notice that
we already have here few elements created in our module
a couple of Web Flows a Web Screen for the home page
will go into detail about all these elements in the
lessons ahead, for now let me just walk you through
the homepage
and to show you that when we create a new Web Screen
in our module you will notice that we already have
a header, a place to put a title
for the screen, the main content area
and the footer and we'll have a menu and so on
we have already these UI template to
create our application. Okay so we have
our module created we said that we're going to store this contact in the
database, so we will need
way to store this information. In OutSystems
to store information, in this case our contacts, we need to create an Entity
and an entity is just a table in the database
to create an Entity will go here into the Data tab. Right-click the
Entities folder
and select add Entity. And I'm going to call it Contact
now we need to define
what information we're going to store about a Contact
and the information we want to store about a Contact is defined by adding
attributes to the Entity. An Attribute is a column
in the database table. By default you notice that the platform
already adds here and ID attribute
that allows you to uniquely identify a contact. This is also known as
a Primary Key
so let's add a couple of Attributes to
the contact Entity. And the first one will be the Name of the contact
and the next one the, Phone Number
okay before we continue to
display these contacts here in the home page, I want to make sure that I have
actual contacts in the database. So I want to bootstrap this
entity with some data. And actually this data, let me show you
this data is present
in this Excel file. We have here a bunch of contacts
with their Name and their Phone Number, and we're going to bootstrap this
information
into the Contact Entity. So many let me just close the
Excel file. And to bootstrap the data, I'm going to righ-click the Entity
and on the Advanced menu, I'm going to select this option
Create Action to Bootstrap Data from Excel file. And I'm going to select here
the Contacts Excel file. This is the mapping between the columns
in the Excel file and the attributes in the Contact Entity. It's all okay let's
proceed
and there we have it
before we continue let me make sure that these contacts are
bootstrapped in the database. We will need to publish
our application for the first time
the platform created a table for the contact
entity in the database and bootstraps
the data that we have on the Excel file into that table
in the database. And on the next lesson we'll see how to fetch the contacts from
the database
and show them here on the screen. That's it.