Streamlining your tech stack for maximum efficiency

Learn, explore, and grow with our knowledge hub.

Power Apps Cascading Dropdowns: Clear the Room When the Site Changes

Smart Statistics · Power Apps tutorial

Clear the room when the site changes

A filtered dropdown is only half the job. Build a site-and-room selector that requires a fresh choice after a site change and checks the relationship before accepting the request.

25 November 2026 · For UK facilities teams and app makers

Illustrative example · all dashboard figures

Facilities request: selection control

3Sites in the fixture
4Room records
0Rooms selected after a site change
Available rooms · Illustrative example Bristol 2 Leeds 2 York 0 · no configured rooms 0 · shared baseline
Illustrative example. These are training records, not client results or capacity measurements.

Expected status: site changed; room choice required

Source list: Sites → Rooms linked by SiteKey → local test requests.

Acceptance rule: the selected RoomKey must match exactly one room belonging to the selected SiteKey.

The costly mistake is a plausible combination

A colleague starts a facilities request for Bristol’s Plant room, then notices that the job belongs in Leeds. If the app retains the old room, the record can look complete while describing an impossible location. A dispatcher then has to phone the requester, correct the job and explain the delay.

Two sites may also have a room called “Reception”. Comparing display text cannot establish which physical room the requester intended. This tutorial uses stable keys, filters the child choices and deliberately clears the child selection whenever the parent changes.

Scope: a new-request demonstration using classic Drop down controls directly on a blank canvas-app screen. You need permission to create a canvas app. The sample uses local collections and requires no connector. It does not persist requests to a business system, edit existing requests or implement a complete work-order app.

Use this pattern for short, single-choice hierarchies. For a large searchable catalogue, assess a suitable search or combo-box experience and connector-specific delegation. Do not copy these classic-control properties into modern controls without checking their API.

Build a fixture that exposes the mistakes

Create a blank canvas app. Select App in the tree, open its OnStart property and paste the formula below. Run OnStart from the App menu. These formulas use comma argument separators and semicolons between actions, as in an English authoring locale.

ClearCollect(
    colSites,
    {SiteKey: "BRI", SiteName: "Bristol"},
    {SiteKey: "LDS", SiteName: "Leeds"},
    {SiteKey: "YRK", SiteName: "York"}
);
ClearCollect(
    colRooms,
    {RoomKey: "BRI-R", SiteKey: "BRI", RoomName: "Reception"},
    {RoomKey: "BRI-P", SiteKey: "BRI", RoomName: "Plant room"},
    {RoomKey: "LDS-R", SiteKey: "LDS", RoomName: "Reception"},
    {RoomKey: "LDS-M", SiteKey: "LDS", RoomName: "Meeting room"}
)

The two Receptions test identity; York tests an empty child list. RoomKey is unique across the fixture, while SiteKey identifies the parent. Keep both keys when a request is accepted. Display names help people choose; keys establish the relationship.

Test-data warning: rerunning this OnStart replaces these two training collections. Keep the formula in a separate test app. Microsoft documents ClearCollect as clearing and then populating a collection. [1]

Make an empty choice intentional

Insert two classic Drop down controls directly on the screen and rename them ddSite and ddRoom. Add visible labels “Site” and “Room”. Set each property separately using the formula bar or property panel.

Parent control: ddSite

Items: colSites
Value: "SiteName"
Default: Blank()
AllowEmptySelection: true
AccessibleLabel: "Site"
OnChange: Reset(ddRoom)

Set Value to the SiteName column. OnChange discards the previous room selection when a user changes the site.

Child control: ddRoom

Items:
Filter(
    colRooms,
    SiteKey = ddSite.Selected.SiteKey
)

Value: "RoomName"
Default: Blank()
AllowEmptySelection: true
AccessibleLabel: "Room at the selected site"
DisplayMode:
If(
    IsBlank(ddSite.Selected.SiteKey),
    DisplayMode.Disabled,
    DisplayMode.Edit
)

Why both blank settings matter: Reset returns a control to its Default. A reset to an old or nonblank default is not a clear. AllowEmptySelection permits no selection; when it is false, the classic dropdown always selects an item. [2] [3]

Filtering supplies the eligible records. Reset addresses the user’s previous choice. Validation checks the pair at acceptance. Treat them as three separate responsibilities. Microsoft’s dependent-dropdown guidance supports writing expressions directly for collection-based examples. [4]

Explain what the requester must do next

Add a label named lblRoomHelp. Set AutoHeight to true and Live to Live.Polite. Give it space below the Room control so its message can wrap. Set its Text property to: [6]

If(
    IsBlank(ddSite.Selected.SiteKey),
    "Choose a site first.",
    IsEmpty(Filter(colRooms, SiteKey = ddSite.Selected.SiteKey)),
    "No rooms are configured for this site. Contact Facilities.",
    IsBlank(ddRoom.Selected.RoomKey),
    "Choose a room for the selected site.",
    "Room selected. Check the site and room before adding the test request."
)

York remains a valid site with no configured rooms. Do not create a fake “Other” room simply to let the request through. Agree a separate operational route for genuinely unmapped locations. Test keyboard navigation and the spoken message with the people who will use the app.

Check the pair at the point of acceptance

Add a button named btnAddTest, with Text set to "Add test request". Leave it enabled so the validation message can explain an incomplete choice. Set OnSelect to the following formula:

With(
    {
        chosenSite: ddSite.Selected.SiteKey,
        chosenRoom: ddRoom.Selected.RoomKey
    },
    If(
        !IsBlank(chosenSite) &&
        !IsBlank(chosenRoom) &&
        CountRows(Filter(colSites, SiteKey = chosenSite)) = 1 &&
        CountRows(
            Filter(
                colRooms,
                RoomKey = chosenRoom && SiteKey = chosenSite
            )
        ) = 1,
        Collect(
            colTestRequests,
            {
                RequestKey: GUID(),
                SiteKey: chosenSite,
                RoomKey: chosenRoom
            }
        );
        Notify("Added to the local test collection only.", NotificationType.Success);
        Reset(ddRoom),
        Notify("Choose a valid site and room pair.", NotificationType.Error)
    )
)

Filter returns matching records; the count checks that the selected pair resolves exactly once in this small fixture. [5] A disabled button alone would not establish that relationship. The button clears the room after acceptance, while retaining the site for another request.

Add a gallery with Items set to colTestRequests. In a label inside it, set Text to ThisItem.SiteKey & " / " & ThisItem.RoomKey. If the collection is initially empty, accept one valid pair to see a row. Selecting Leeds Reception must show LDS / LDS-R.

This is a local test: Collect creates the test collection when first used. The notification does not mean a work order was saved remotely. Closing the app can lose this data. For production, replace the local acceptance path with a durable write, handle its success and failure, and enforce the relationship in the trusted data or service layer as well.

Test the transition, not just the first selection

Expected behaviour for the illustrative fixture
Action Expected result Failure exposed
Open the app without choosing a site. Site and room blank; Room disabled; Add test request rejects. Unintended first-item defaults.
Choose Bristol, then Plant room; change to Leeds. Room blank; only Leeds rooms offered; acceptance waits for a new choice. A stale child selection.
Select Leeds Reception and accept. One test row with LDS and LDS-R; room clears. Joining on the label “Reception”.
Select York. No room choices; explanatory message; no accepted request. Empty lists silently treated as valid.
In the test fixture, duplicate the LDS-R room record; rerun OnStart and try it. Acceptance rejects because the pair matches twice. Remove the duplicate afterwards. An ambiguous mapping.
Change sites repeatedly using keyboard input. Each site change clears the room; the help message remains available. Interaction or accessibility gaps.

Also test a production mapping removed between loading the screen and submitting. A stale local collection cannot detect a server-side change by itself. Decide whether the authoritative service rejects the request or routes it for review, and preserve the requester’s other details after a failed write.

Best practice: own the relationship beyond the screen

Facilities owns the mapping. Give each room a stable identifier and one approved parent. Agree how closed rooms, site moves and renames affect new requests and historical records. Keep the reference data separate from submitted requests; Microsoft recommends separate parent and child data sources for enterprise use. [4]

The app owner owns the transition. Document the blank defaults, reset rule and acceptance tests. For editing an existing request, load its saved site and room deliberately, then clear the room only when the user changes the site. This new-request formula is not a complete edit-form pattern. Reset also has container restrictions: controls inside a form or gallery cannot be reset from outside that container. [2]

The data owner owns enforcement. A client-side filter is not an access control or a database constraint. Enforce permitted site access and valid site-room relationships in the authoritative layer. When replacing collections with SharePoint or Dataverse, review the connector’s delegation behaviour; do not assume a local CountRows(Filter(...)) check remains complete against a large remote table.

The service manager measures the benefit. During a pilot, record requests corrected for site-room mismatches, clarification contacts and median time to dispatch. Compare equivalent work and volumes before and after release. Track blocked submissions too: a rise may reveal missing room mappings. These are proposed measures, not promised savings.

Is the selector ready for a pilot?

Tick only controls you have demonstrated. This self-assessment is not an automated inspection of your app; nothing is sent or stored.

Evidence checklist
0 of 5 evidenced. Complete the three essential selection checks first.

Frequently asked questions

Why does Reset not always clear a dropdown?

Reset restores the Default value. This example combines a blank Default with AllowEmptySelection set to true so that resetting the room leaves no selection.

Can two sites have a room called Reception?

Yes. Display the room name, but identify the room by its stable RoomKey and validate its SiteKey. A shared label does not mean the rooms are the same record.

Does this example save a real facilities request?

No. It adds a record to a local test collection. Production needs a durable data source, write-error handling and authoritative relationship validation.

Can I paste the formulas into an existing edit form?

Not unchanged. This example uses standalone classic controls for new requests. Existing-record defaults and reset boundaries must be designed and tested separately.

Make the next request correct at the point of entry

Smart Statistics helps UK businesses build Power Apps that reflect real operational rules. Bring one troublesome form and a few rejected or corrected requests; we can turn them into a practical design and test plan.