Stage 12 of 17

Stage 12 of 17

Troubleshooting

11 troubleshooting scenarios covering the most common issues in the Software Licence Management application.

TS-001

AnnualisedCost shows the wrong value for a monthly agreement

Reported

"Tom Reeves reports that AGR-001 (Microsoft 365, 300 licences, £15.90/month) shows an AnnualisedCost of £4,770 instead of £57,240."

Expected

£57,240 (300 × £15.90 × 12).

Actual

£4,770 (300 × £15.90 × 1 — the Monthly × 12 multiplier is missing).

Evidence to Gather

  1. 1.Check the AnnualisedCost formula in the gallery. Is the Monthly branch multiplying by 12?
  2. 2.Check the BillingFrequency value for AGR-001 in SharePoint. Is it exactly "Monthly" (case-sensitive)?

Likely Cause

The AnnualisedCost formula is missing the × 12 multiplier for the Monthly branch. Or the BillingFrequency value is not exactly "Monthly" (e.g. "monthly" or "Monthly " with a trailing space).

Fix

Correct the formula: If(ThisItem.BillingFrequency = "Monthly", ThisItem.UnitCost * ThisItem.QuantityPurchased * 12, ...). Check the BillingFrequency choice values in SharePoint — they must match exactly.

Retest

Verify AGR-001 shows £57,240. Verify AGR-002 (Annual) shows £15,600. Verify AGR-005 (3-Year) shows £20,000.

TS-002

QuantityAllocated shows 0 for all agreements even though allocations exist

Reported

"James Okafor reports that all agreements show QuantityAllocated = 0 and QuantityAvailable = QuantityPurchased, even though he can see allocations in the Allocations list."

Expected

QuantityAllocated = count of active allocations for each agreement.

Actual

QuantityAllocated = 0 for all agreements.

Evidence to Gather

  1. 1.Check the QuantityAllocated formula: CountRows(Filter(colAllocations, Agreement.Id = ThisItem.ID, Status = "Active")).
  2. 2.Check whether colAllocations is populated. Add a temporary label with Text = CountRows(colAllocations) to verify.
  3. 3.Check the Agreement Lookup column in the Allocations list — is it returning an Id?

Likely Cause

colAllocations is empty (the ClearCollect in App OnStart failed), or the Agreement.Id comparison is incorrect. SharePoint Lookup columns return an object — the ID is at Agreement.Id, not Agreement.

Fix

Verify colAllocations is populated. Check the ClearCollect formula in App OnStart. Verify the filter uses Agreement.Id = ThisItem.ID (not Agreement = ThisItem.ID).

Retest

Navigate to Licence Details for AGR-001. Verify QuantityAllocated = 305.

TS-003

Renewal reminder emails are being sent multiple times for the same milestone

Reported

"Priya Mehta reports she received 3 "90-day reminder" emails for AGR-003 on consecutive days."

Expected

One reminder email per milestone per agreement.

Actual

Multiple emails for the same milestone.

Evidence to Gather

  1. 1.Check the DToDLab013-RenewalReminder flow run history.
  2. 2.Check the ReminderSentFlags field for AGR-003 in the Agreements list. Does it contain "90"?
  3. 3.Check the Update item action in the flow — did it succeed on the first run?

Likely Cause

The Update item action that sets ReminderSentFlags failed on the first run. The flow sent the email but did not update the flag. On subsequent runs, the flag was still blank, so the condition passed again.

Fix

Add error handling to the Update item action. Verify the flow connection has Edit permission on the Agreements list. Check the ReminderSentFlags column internal name in SharePoint.

Retest

Clear ReminderSentFlags for a test agreement. Run the flow twice. Verify only one email is sent and ReminderSentFlags is updated after the first run.

TS-004

Availability alert is not being sent when QuantityAvailable reaches the threshold

Reported

"Tom Reeves reports that AGR-002 (Adobe, 25 licences) has only 2 licences available but he has not received an availability alert."

Expected

An availability alert is sent when QuantityAvailable ≤ threshold (2 for AGR-002: max(1, int(25 × 0.1)) = 2).

Actual

No alert sent.

Evidence to Gather

  1. 1.Check the DToDLab013-AvailabilityAlert flow run history. Did the flow run when the last allocation was created?
  2. 2.Check the Get items filter query — is it returning the correct allocations?
  3. 3.Check the threshold calculation — is it using the correct formula?

Likely Cause

Most likely causes: (1) The flow is turned off. (2) The Get items filter query is incorrect. (3) The threshold calculation is wrong — int(25 × 0.1) = int(2.5) = 2, which is correct, but if the formula uses round() instead of int(), it may produce 3 instead of 2.

Fix

Verify the flow is turned on. Check the Get items filter query. Verify the threshold formula uses int() not round(): max(1, int(mul(QuantityPurchased, 0.1))).

Retest

Create a test agreement with 10 licences. Allocate 9 licences. Verify the alert fires when the 9th allocation is created (QuantityAvailable = 1 = threshold).

TS-005

New Allocation Save button is disabled even though licences are available

Reported

"James Okafor reports he cannot save a new allocation for AGR-007 (Zoom, 50 licences, 12 active allocations). The Save button is greyed out and the "No licences available" warning is showing."

Expected

Save button is enabled when QuantityAvailable > 0.

Actual

Save button is disabled and warning is showing, even though QuantityAvailable = 38.

Evidence to Gather

  1. 1.Check the varQtyAvailableOnForm variable. What value is it showing?
  2. 2.Check the OnChange formula for the Agreement dropdown (ddNewAgreement). Is it calculating QuantityAvailable correctly?
  3. 3.Check whether the Agreement dropdown has a selected value.

Likely Cause

The Agreement dropdown OnChange formula is not running, or is returning 0. This can happen if the dropdown is pre-populated from varAllocationAgreement but the OnChange formula does not run on pre-population (it only runs when the user changes the selection).

Fix

Move the QuantityAvailable calculation to the screen OnVisible formula: Set(varQtyAvailableOnForm, LookUp(colAgreements, ID = varAllocationAgreement.ID).QuantityPurchased - CountRows(Filter(colAllocations, Agreement.Id = varAllocationAgreement.ID, Status = "Active"))). This ensures the value is calculated when the screen loads, not just when the dropdown changes.

Retest

Navigate to New Allocation from Licence Details for AGR-007. Verify QuantityAvailable = 38 and the Save button is enabled.

TS-006

Compliance Report screen shows "Access Denied" for Tom Reeves

Reported

"Tom Reeves reports he cannot access the Compliance Report screen."

Expected

Tom Reeves (IT Team Lead) has full access to the Compliance Report.

Actual

Screen shows "Access Denied".

Evidence to Gather

  1. 1.Check the varIsFinanceOrIT variable. Is it true for Tom Reeves?
  2. 2.Check the varITEmails collection in App OnStart. Is tom.reeves@contoso.com in the list?
  3. 3.Check whether User().Email matches the email in the collection exactly (case-sensitive).

Likely Cause

Tom Reeves' email address in the varITEmails collection does not match User().Email exactly. Power Apps email comparisons are case-sensitive. If the collection contains "Tom.Reeves@contoso.com" but User().Email returns "tom.reeves@contoso.com", the comparison fails.

Fix

Use Lower() to normalise the comparison: Set(varIsIT, Lower(User().Email) in Lower(varITEmails)). Or ensure all email addresses in the collection are lowercase.

Retest

Log in as Tom Reeves. Navigate to the Compliance Report screen. Verify it loads correctly.

TS-007

Deallocated licences are still counted in QuantityAllocated

Reported

"James Okafor reports that after deallocating 5 licences from AGR-001, QuantityAllocated has not decreased."

Expected

QuantityAllocated decreases by 1 for each deallocation.

Actual

QuantityAllocated remains unchanged after deallocation.

Evidence to Gather

  1. 1.Check the Deallocate button OnSelect formula. Is it setting Status = "Inactive"?
  2. 2.Check whether the Patch formula is updating the correct record.
  3. 3.Check whether colAllocations is being refreshed after the Patch.

Likely Cause

The Patch formula is updating the SharePoint list but colAllocations is not being refreshed. The QuantityAllocated formula reads from colAllocations, not directly from SharePoint, so it shows the stale value.

Fix

Add Refresh(colAllocations) or ClearCollect(colAllocations, Allocations) after the Patch formula in the Deallocate button OnSelect.

Retest

Deallocate a licence from AGR-001. Verify QuantityAllocated decreases by 1 immediately.

TS-008

ReminderSentFlags shows "|90" (leading pipe) after the first reminder

Reported

"Tom Reeves notices that ReminderSentFlags for AGR-003 shows "|90" instead of "90" after the first reminder."

Expected

ReminderSentFlags = "90" after the first reminder.

Actual

ReminderSentFlags = "|90".

Evidence to Gather

  1. 1.Check the Update item action in the flow.
  2. 2.What is the expression for ReminderSentFlags?

Likely Cause

The expression is: concat(items('Apply_to_each')?['ReminderSentFlags'], '|', '90'). When ReminderSentFlags is blank, this produces "|90" (blank + pipe + 90).

Fix

Use the conditional expression: if(empty(items('Apply_to_each')?['ReminderSentFlags']), '90', concat(items('Apply_to_each')?['ReminderSentFlags'], '|90')). This produces "90" when blank and "90|60" when appending.

Retest

Clear ReminderSentFlags for a test agreement. Run the flow. Verify ReminderSentFlags = "90" (no leading pipe). Run again for the 60-day milestone. Verify ReminderSentFlags = "90|60".

TS-009

Total Annualised Spend on the Dashboard shows 0

Reported

"Sandra Obi reports the Total Annualised Spend KPI card on the Dashboard shows £0."

Expected

Total Annualised Spend = sum of AnnualisedCost for all active agreements (approximately £199,000 from sample data).

Actual

Total Annualised Spend = £0.

Evidence to Gather

  1. 1.Check the Sum formula in the KPI card.
  2. 2.Is it using the correct AnnualisedCost formula inside the Sum?
  3. 3.Check whether colAgreements is populated.

Likely Cause

The Sum formula is referencing a column named AnnualisedCost that does not exist in SharePoint (it is calculated in the app). The formula must calculate AnnualisedCost inline: Sum(Filter(colAgreements, Status = "Active"), If(BillingFrequency = "Monthly", UnitCost * QuantityPurchased * 12, If(BillingFrequency = "Annual", UnitCost * QuantityPurchased, UnitCost * QuantityPurchased / 3))).

Fix

Replace the Sum formula with the inline calculation. Verify the result matches the expected total from the sample data.

Retest

Navigate to the Dashboard. Verify Total Annualised Spend ≈ £199,000 (sum of all active agreement AnnualisedCosts from sample data).

TS-010

Department manager can see all allocations, not just their own department

Reported

"Marcus Webb (Operations) reports he can see Finance, HR, and Marketing allocations in the Power App."

Expected

Marcus Webb sees only Operations allocations.

Actual

Marcus Webb sees all allocations.

Evidence to Gather

  1. 1.Check the Allocations gallery Items formula.
  2. 2.Is it filtering by department for department managers?
  3. 3.Check whether varIsDeptManager is true for Marcus Webb.
  4. 4.Check whether varCurrentUserDept is set correctly.

Likely Cause

The department filter is not applied for department managers. The gallery Items formula must include: If(varIsDeptManager, Filter(colAllocations, Status = "Active", Department = varCurrentUserDept), Filter(colAllocations, Status = "Active")).

Fix

Add the department filter to the gallery Items formula. Set varCurrentUserDept in App OnStart based on the current user's email address.

Retest

Log in as Marcus Webb. Navigate to the Allocations screen. Verify only Operations allocations are shown.

TS-011

StatusTransition flow is not updating agreements to Pending Renewal

Reported

"Tom Reeves reports that AGR-003 (RenewalDate = 31 Mar 2027, 89 days away) still shows Status = Active."

Expected

AGR-003 Status = Pending Renewal (within 90 days of RenewalDate).

Actual

AGR-003 Status = Active.

Evidence to Gather

  1. 1.Check the DToDLab013-StatusTransition flow run history. Did the flow run today?
  2. 2.Check the DaysToRenewal calculation in the flow. Is it returning the correct value?
  3. 3.Check the Condition — is it using <= 90 or < 90?

Likely Cause

The Condition uses < 90 instead of <= 90. With 89 days remaining, < 90 is true, so this should work. More likely: the ticks calculation is incorrect, or the flow has not run today.

Fix

Verify the flow ran today. Check the ticks calculation — ensure it is using utcNow() not a hardcoded date. Manually trigger the flow and check the DaysToRenewal output for AGR-003.

Retest

Manually trigger DToDLab013-StatusTransition. Verify AGR-003 Status changes to Pending Renewal.

Stage Complete — What You Now Have

  • ✓11 troubleshooting scenarios
  • ✓Covers: AnnualisedCost formula, QuantityAllocated, duplicate reminders, availability alert, Save button disabled, Compliance Report access, deallocation refresh, leading pipe bug, Total Annualised Spend, department filtering, StatusTransition
NextRelease

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