Stage 5 of 17

Stage 5 of 17

Data Model

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?

A data dictionary is the single source of truth for what every field means, what type it is, who sets it, and what values are valid. Without it, different people build different assumptions into the app and the flow, and the data becomes inconsistent. Write the data dictionary before you create a single column.

Data Dictionary — Leave Requests List

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

Single line of textRequired

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

Single line of textRequired

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

Single line of textRequired

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

Single line of textRequired

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

Single line of textRequired

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

ChoiceRequired

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

Date and Time (date only)Required

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

Date and Time (date only)Required

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

NumberOptional

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

Multiple lines of textOptional

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

ChoiceRequired

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

Date and TimeOptional

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

Date and TimeOptional

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

Single line of textOptional

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

Multiple lines of textOptional

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

Date and Time (system)Required

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

Date and Time (system)Required

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.

Why Store Both Names and Email Addresses?

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).

Working Days — Stored or Calculated?

An Important Design Question

Should the number of working days be stored in the list, or calculated on the fly when needed? This is a genuine design decision with trade-offs on both sides.

Arguments for Storing the Value

  • ✓The value is available for reporting without recalculating every time.
  • ✓If the calculation logic changes in the future, historical records retain the original calculated value.
  • ✓The flow can use the stored value directly without needing to recalculate.

Arguments Against Storing the Value

  • ✗If the start or end date is changed after submission, the stored value becomes stale.
  • ✗It creates a redundant field — the value can always be derived from the dates.
  • ✗It adds complexity to the app (the app must calculate and store the value on submission).

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.

The Real Complexity of Working Days

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

When a user asks "why does the system show 5 working days when I'm only taking 4 days because of the bank holiday?", you now have the answer: the v1 calculation excludes weekends only. This is a known limitation documented in the support guide. The fix would require adding a bank holiday calendar — a future improvement.

Sample Data

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.

RefEmployeeLeave TypeStartEndDaysStatus
LR-001James OkaforAnnual Leave15/03/202719/03/20275Approved
LR-002James OkaforAnnual Leave07/04/202711/04/20275Submitted
LR-003Sophie NguyenAnnual Leave01/04/202704/04/20274Approved
LR-004Sophie NguyenSick Leave22/03/202723/03/20272Approved
LR-005Ravi PatelAnnual Leave14/04/202725/04/202710Rejected
LR-006Ravi PatelAnnual Leave28/04/202702/05/20275Submitted
LR-007Chloe AdeyemiOther17/03/202717/03/20271Approved
LR-008Chloe AdeyemiAnnual Leave31/03/202731/03/20271Cancelled
LR-009Marcus WebbAnnual Leave24/03/202728/03/20275Approved
LR-010Aisha PatelAnnual Leave08/04/202709/04/20272Draft

Try It Yourself — Data Model Analysis

  1. 1.LR-005 (Ravi Patel, 10 days, Rejected) and LR-006 (Ravi Patel, 5 days, Submitted) are from the same employee. What does this tell you about the business process? What should the system do to help the manager see that Ravi already had a request rejected?
  2. 2.The ManagerEmail field is entered by the employee. What would happen if James Okafor entered his own email address as the manager email? How could you add a validation rule to prevent this?
  3. 3.The Working Days field excludes weekends only. LR-001 runs from 15/03/2027 (Monday) to 19/03/2027 (Friday). How many working days is that? Now check: does 15/03/2027 fall on a bank holiday in England? (Hint: check the 2027 bank holiday calendar.)
  4. 4.The data model has no field for "Leave Balance" (how many days the employee has remaining). Why was this excluded from scope? What would you need to add to the data model to support leave balance tracking?

Stage Complete — What You Now Have

  • ✓A complete data dictionary for all 17 fields in the Leave Requests list
  • ✓Understanding of why both names and email addresses are stored
  • ✓A clear explanation of the working days calculation and its limitations
  • ✓Four real-world complexities documented (weekends, bank holidays, part-time, half days)
  • ✓10 sample records covering all five status values

Need more help with the concepts?

Visit DosToDigital for guides, templates, and deeper explanations.

DosToDigital
DToD Labs

Learn it. Build it. Make it work.

A DosToDigital Project

About DToD Labs

Practical technology learning for Microsoft 365 and Power Platform. Build real business solutions from real business problems.

Learn the concepts at DosToDigital. Put them into practice at DToD Labs.

DToD Labs provides practical learning projects for educational purposes. Microsoft services, interfaces, licensing and product capabilities change over time. Always check current Microsoft documentation and licensing before implementing a solution in a production environment. All organisations, business scenarios and data used in DToD Labs are fictional. Learners should not use confidential employer, customer or personal information when following DToD Labs exercises.

© 2026 DToD Labs — A DosToDigital Project