> 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/using-triggers/exercise-entity-and-entity-triggers.md).

# Exercise: Entity & Entity triggers

## Requirements

Define two triggers for the entity “UserName\_Acc\_customers” (click here to see entity creation steps):&#x20;

* After Create Trigger: This trigger is initiated when a record is created in the entity. If the value in the entity field Join\_Date is present, Actions will be initiated to update the value of the field DayMonthJoinDate in coherence with the values of day and month in the Join\_Date value.
* After Update Trigger: This trigger is initiated when a record is updated in the entity. If the value in the Join\_Date or DayMonthJoinDate has been modified after the update, Actions will be initiated to update the DayMonthJoinDate value to be the same as the Join\_Date value.

## Solution

The solution is implemented in two steps:&#x20;

* Step 1: Define the “After Create” Trigger to update the value in DayMonthJoinDate according to Join\_Date when a record is created.&#x20;
* Step 2: Define the “After Update” Trigger to update the value in DayMonthJoinDate according to the updated value in Join\_Date.
