# Step 1: Create the Activities entity

The first step is to create the entity for storing records.

* To go to the Entity database, click “Entity database” under the “Database” menu on the left side panel.
*

```
<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5entitiesdbmenu.png" alt=""><figcaption></figcaption></figure>
```

* To create a new entity, click the \[+ Entity] button on the displayed page.

<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_2/ch2whatisanentity_addentity.png" alt=""><figcaption></figcaption></figure>

* The New Entity settings page is displayed. To label the entity, enter the Entity name as “UserName\_Acc\_Activities”.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5ex1activname.png>" %}

* Optionally add a description.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5ex1activdesc.png>" %}

* The Field tab is preselected with one field created by default.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5ex1activfield.png>" %}

* To hold the primary key for this entity, define the field for Activity ID as follows. (This field will be auto-generated and will be displayed in the Entity):
  1. Enter the field name as “Activity\_ID”.
  2. Select Data Type as “GUID”.
  3. Select “Primary”.
  4. Select “Auto Generate”.
  5. Select “Display”.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5ex1activactivityidf.png>" %}

* To create a new field, click the \[+ Field] button.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5ex1addfield.png>" %}

* Add eight more fields, ensuring a total of nine (9) fields.
* To hold the information for the Activity Type, define a field as follows:
  1. Enter the field name as “Activity\_Type”. This field indicates the type of activity for the customer.
  2. Select Data Type as “string”.
  3. Select “Display”.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5ex1activactivitytypef.png>" %}

* To describe the activity for the customer, create a field as follows:
  1. Enter the field name as “Activity\_Description”. This field describes the type of activity for the customer.
  2. Select Data Type as “string”.
  3. Select “Display”.
  4. Select the “Default Field”.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5ex1activactivitydescf.png>" %}

* To store the detail of timing for the activity, define the field as follows:
  1. Enter the field name as “Activity\_DateTime”. This field indicates the exact date and time of activity for the customer.
  2. Select Data Type as “DateTime”.
  3. Select “Display”.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5ex1activactivitydtf.png>" %}

* To store the customer ID detail, define the field as follows:
  1. Enter the field name as “Customer\_ID”. This is the customer identification field Customer ID and will be the field for establishing a 1-to-many relation between entities “UserName\_Acc\_customers” and “UserName\_Acc\_Activities”.
  2. Select Data Type as “GUID”.
  3. The default value will be displayed.
  4. Select “Display”.

<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5ex1activcustidf.png" alt=""><figcaption></figcaption></figure>

* To store the value of the activity priority level, define the field as follows:
  1. Enter the field name as “Activity\_Priority”.
  2. Select Data Type as “integer”.
  3. The default value is set to “0”.
  4. Select “Display”.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5ex1activpriorityf.png>" %}

* To create a field for Assigned To, which contains the details of the resource/team the customer activity is assigned to, define a field as follows:
  1. Enter the field name as “Activity\_AssignedTo”.
  2. Select Data Type as “string”.
  3. Enter default value as “Helpdesk Team”.
  4. Select “Display”.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5ex1activassignedtof.png>" %}

* To store the details of the resource/team recording or documenting the customer activity, define the field as follows:
  1. Enter the field name as “Activity\_CreatedBy”.
  2. Select Data Type as “string”.
  3. Enter default value as “Sales Team”.
  4. Select “Display”.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5ex1activcreatedbyf.png>" %}

* To store the details related to activity status of the customer, define the field as follows:
  1. Enter the field name as “Activity\_Status”.
  2. Select Data Type as “string”.
  3. Select “Display”.

{% embed url="<https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5ex1activstatusf.png>" %}

* To save the fields, click the \[Save] button.

<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5saveentity.png" alt=""><figcaption></figcaption></figure>

* To finish creating the Entity, click the \[Close] button.

<figure><img src="https://media.langstack.com/documentation/media/images/code/training_manual/chapter_5/ch5closeentity.png" alt=""><figcaption></figcaption></figure>
