Stage 12 of 17
11 troubleshooting scenarios covering the most common issues in the Software Licence Management application.
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
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.
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
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.
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
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.
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
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).
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
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.
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
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.
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
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.
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
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".
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
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).
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
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.
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
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.
Need more help with the concepts?
Visit DosToDigital for guides, templates, and deeper explanations.