Stage 5 of 17
The data model defines exactly what information the system stores, how it is structured, and who sets each value. In this stage you will build the complete data dictionary for the Leave Requests list and explore important design questions around working days, stored vs calculated values, and why storing both names and email addresses matters.
Why Are We Doing This?
The Leave Requests list has 17 fields. Each field is documented below with its type, who sets it, its purpose, an example value, and any important notes.
Title (Request Reference)
Title
Set By
Power Apps (auto-generated)
Example
LR-20260315-0042
Purpose
A unique reference for the request, used for display and searching. Auto-generated by the app using a pattern such as "LR-" + the current date + a random number.
Note: Microsoft Lists requires a Title column. We repurpose it as the request reference.
Employee Name
EmployeeName
Set By
Power Apps (from User() function)
Example
James Okafor
Purpose
The display name of the employee submitting the request. Captured automatically from the logged-in user's Microsoft 365 profile.
Note: Stored as a text string, not a Person column, to simplify the flow. See discussion below.
Employee Email
EmployeeEmail
Set By
Power Apps (from User() function)
Example
james.okafor@contoso.co.uk
Purpose
The email address of the employee. Used by the Power Automate flow to send the decision notification.
Note: Critical for the notification email. Must be a valid email address.
Manager Name
ManagerName
Set By
Employee (entered in the app)
Example
Priya Sharma
Purpose
The display name of the employee's line manager. Entered by the employee. Used for display purposes.
Note: See DD-002: stored as text, not looked up from Azure AD.
Manager Email
ManagerEmail
Set By
Employee (entered in the app)
Example
priya.sharma@contoso.co.uk
Purpose
The email address of the line manager. Used by the Power Automate flow to send the approval request.
Note: The most critical field for the flow. If incorrect, the approval email goes to the wrong person.
Leave Type
LeaveType
Set By
Employee (selected in the app)
Example
Annual Leave
Purpose
The category of leave being requested. Determines how the request is classified in reports.
Note: Choices: Annual Leave, Sick Leave, Other. Fill-in choices must be disabled.
Start Date
StartDate
Set By
Employee (entered in the app)
Example
15/03/2027
Purpose
The first day of the requested leave period.
Note: Must be validated: cannot be blank; cannot be after End Date.
End Date
EndDate
Set By
Employee (entered in the app)
Example
19/03/2027
Purpose
The last day of the requested leave period.
Note: Must be validated: cannot be blank; cannot be before Start Date.
Working Days
WorkingDays
Set By
Power Apps (calculated)
Example
5
Purpose
The number of working days between Start Date and End Date, excluding weekends. Informational only — not used for leave balance deduction in v1.
Note: Calculated in the app using a formula. Excludes weekends only (bank holidays not in scope for v1). See discussion below.
Employee Comments
EmployeeComments
Set By
Employee (entered in the app)
Example
Family holiday booked — flights already purchased.
Purpose
Optional free-text comments from the employee, such as the reason for the request or context for the manager.
Note: Plain text only. No rich formatting required.
Status
Status
Set By
Power Apps (on submit) / Power Automate (on decision)
Example
Submitted
Purpose
The current state of the request in the approval lifecycle. See the status lifecycle in Stage 4.
Note: Choices: Draft, Submitted, Approved, Rejected, Cancelled. Default: Draft. Must be read-only in the app for employees (SEC-005).
Submitted Date
SubmittedDate
Set By
Power Apps (on submit)
Example
10/03/2027 09:14
Purpose
The date and time the employee submitted the request. Used for audit and reporting.
Note: Set automatically by the app when the employee selects Submit. Not editable.
Decision Date
DecisionDate
Set By
Power Automate (on manager response)
Example
11/03/2027 14:32
Purpose
The date and time the manager made their decision. Used for audit and SLA reporting.
Note: Set automatically by the flow. Must be read-only in the app (SEC-005).
Approver
Approver
Set By
Power Automate (on manager response)
Example
Priya Sharma
Purpose
The name of the person who made the approval decision. Populated by the flow from the approval response.
Note: Set automatically by the flow. Must be read-only in the app (SEC-005).
Approver Comments
ApproverComments
Set By
Power Automate (from manager's approval response)
Example
Sorry, too many people off that week. Could you move to the following week?
Purpose
Comments added by the manager when approving or rejecting. Particularly important for rejections (DF-004).
Note: Set automatically by the flow from the manager's comments in the approval email. Must be read-only in the app (SEC-005).
Created
Created
Set By
SharePoint (automatic)
Example
10/03/2027 09:10
Purpose
The date and time the list item was created. Provided automatically by SharePoint.
Note: System field. Cannot be modified.
Modified
Modified
Set By
SharePoint (automatic)
Example
11/03/2027 14:32
Purpose
The date and time the list item was last modified. Updated automatically by SharePoint on every change.
Note: System field. Cannot be modified. Useful for audit — shows when the flow last updated the record.
The data model stores both the display name (e.g. "James Okafor") and the email address (e.g. "james.okafor@contoso.co.uk") for both the employee and the manager. This is deliberate.
Why the email address is the reliable identifier
Display names are not unique. There could be two people called "James Okafor" in a large organisation. Email addresses are unique within a Microsoft 365 tenant — no two users can have the same email address. The Power Automate flow uses the email address to send notifications, not the display name. If you only stored the display name, the flow would have no reliable way to send the email.
Why the display name is still useful
Email addresses are not human-readable in reports and views. "james.okafor@contoso.co.uk" is less readable than "James Okafor" in an HR report. Storing both means you can display the name to humans while using the email address for automated processes.
The limitation of this approach
In this solution, the employee enters the manager's name and email address manually. This means the data is only as accurate as what the employee types. A more robust solution would look up the manager from Azure Active Directory (now Microsoft Entra ID) using the Azure AD connector — but that requires a premium licence. This is documented as a known limitation (DD-002).
An Important Design Question
Arguments for Storing the Value
Arguments Against Storing the Value
Decision for this lab
We will store the working days value in the list (FR-019). The value is calculated by the app when the employee selects the dates and stored when the request is submitted. The value is informational only — it is not used for leave balance deduction. If the dates are changed (which is not supported in v1 after submission), the stored value would need to be recalculated.
Calculating working days sounds simple but becomes complex quickly in a real HR context. This section explains why — not to solve the problem in this lab, but to ensure you understand the limitations of the v1 solution.
Weekends
V1 approach
Exclude Saturdays and Sundays.
Real-world complexity
Some employees work non-standard weeks (e.g. Tuesday to Saturday). A simple weekend exclusion would be wrong for them.
Bank holidays
V1 approach
Not handled in v1.
Real-world complexity
Bank holidays vary by country, region, and year. England, Scotland, and Northern Ireland have different bank holidays. A correct calculation requires a bank holiday calendar that is updated annually.
Part-time working patterns
V1 approach
Not handled in v1.
Real-world complexity
A part-time employee who works three days a week should have their leave counted in days relative to their working pattern, not a full-time equivalent. A three-day week employee taking "one week" of leave uses three days, not five.
Half days
V1 approach
Not handled in v1.
Real-world complexity
Many organisations allow half-day leave requests. The data model would need to support fractional days, and the calculation would need to handle start and end times.
Application Support View
You will enter the following sample records during the Prepare stage (Stage 7). Review them now to understand the range of scenarios the system needs to handle.
| Ref | Employee | Leave Type | Start | End | Days | Status |
|---|---|---|---|---|---|---|
| LR-001 | James Okafor | Annual Leave | 15/03/2027 | 19/03/2027 | 5 | Approved |
| LR-002 | James Okafor | Annual Leave | 07/04/2027 | 11/04/2027 | 5 | Submitted |
| LR-003 | Sophie Nguyen | Annual Leave | 01/04/2027 | 04/04/2027 | 4 | Approved |
| LR-004 | Sophie Nguyen | Sick Leave | 22/03/2027 | 23/03/2027 | 2 | Approved |
| LR-005 | Ravi Patel | Annual Leave | 14/04/2027 | 25/04/2027 | 10 | Rejected |
| LR-006 | Ravi Patel | Annual Leave | 28/04/2027 | 02/05/2027 | 5 | Submitted |
| LR-007 | Chloe Adeyemi | Other | 17/03/2027 | 17/03/2027 | 1 | Approved |
| LR-008 | Chloe Adeyemi | Annual Leave | 31/03/2027 | 31/03/2027 | 1 | Cancelled |
| LR-009 | Marcus Webb | Annual Leave | 24/03/2027 | 28/03/2027 | 5 | Approved |
| LR-010 | Aisha Patel | Annual Leave | 08/04/2027 | 09/04/2027 | 2 | Draft |
Need more help with the concepts?
Visit DosToDigital for guides, templates, and deeper explanations.