in this lesson we will start with a new web application to manage contacts
this application will store these contacts in the database
and it's going to be called phone book but first let me show you the
application
so
this is the phone book application that we're going to build it's going to manage
contacts
and for each contact we're going to have a couple of attributes like the name and
the phone number
and also the company the company that the contact belongs to
so let's close this and let's create our application
and let me give here a simple description
simple contact management
application and I'm going to choose an icon for this application
and this icon is on the resources of this video so you can download and use
also this icon for your application if you're following this video
and now we'll need to choose a template
for our application the London template which is the one that is chosen
here and it's the one that we're going to use
this is a responsive template that is prepared to work on desktop
and mobile devices like tablets and smartphones
so let's go ahead and create a module for our application using this London template
and you will notice that
we already have here a few elements created in our module
a couple of web flows a web screen for the home page
we'll go into detail about all these elements in the
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 a footer and we'll have a menu and so on so
we have already this UI template to
create our application okay so
we have our model created we said that we're going to store these contacts in the
database so we will need
a 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
we need to define - let me just expand this here - we need to define
what information we're going to store about a contact
and the information we want to store about the 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 the
primary key
so let's add a couple 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 you'll see that 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 let me just close here the
excel file and to bootstrap to data I'm going to right 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 and to do this we will need to publish
our application for the first time in this publish
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