> For the complete documentation index, see [llms.txt](https://docs.langstack.com/welcome/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.langstack.com/welcome/get-started/learn-langstack/introduction-to-entities/exercise-1-customer-accounts-and-activities/customer-activities/step-1-create-the-activities-entity.md).

# 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>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.langstack.com/welcome/get-started/learn-langstack/introduction-to-entities/exercise-1-customer-accounts-and-activities/customer-activities/step-1-create-the-activities-entity.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
