Build an Offline-Ready Emergency App

Build a Canvas App with offline mode, Dataverse, and weather alerts.

Introduction

30 Second Summary

When disaster strikes, emergency teams need to track personnel deployments from the field. Often, they're working in areas with spotty or no internet connectivity. A reliable app that works offline and syncs when a connection returns can be the difference between coordinated response and chaos.

In this project, you will build an offline-ready emergency deployment tracking app using Power Apps. The app logs deployment statuses to a Dataverse table, works without connectivity, and pulls real-time weather alerts from the National Weather Service API through a Cloud Flow.

What You'll Build

A responsive Canvas App called "Emergency Deployment Tracker" that emergency personnel use to log deployment statuses in the field, featuring offline capability and live weather alert integration.

By the end of this project, you'll have:

  • A custom Dataverse table storing deployment records with personnel names, statuses, locations, and timestamps.
  • A responsive Canvas App built with Fluent UI Modern Controls that adapts between tablet and mobile form factors.
  • An offline profile enabling the app to function without connectivity and sync when back online.
  • A Cloud Flow triggered from the app that retrieves real-time NWS weather alerts using an environment variable for portability.
  • Secret Mission: Add a deployment history gallery with status filtering using the Modern Table control's responsive ReflowBehavior.

Are there any prerequisites?

You need a Power Apps Premium license ($20/user/month), which enables Dataverse in production and sandbox environments. You also need a Power Platform environment with Dataverse already provisioned and maker access to that environment.

This is Project 1 in a three-project series. The Premium license covers all three projects, enabling features like column-level security, Dataverse auditing, and Power Platform pipelines in later projects.

Set Up Your Solution and Dataverse Table

Every component you build in this project needs a home. In Power Platform, that home is a solution.

A solution bundles your tables, apps, flows, and environment variables into a single portable package. When you move the app to a different environment later, everything travels together. In this step, you will create the solution and the custom Dataverse table that stores deployment records.

In this step, get ready to:
  • Create a Dataverse solution to hold all project components.
  • Build a custom Emergency Deployment table with five columns.
  • Add sample data and verify the table inside the solution.
Create a new solution

Solutions act as containers for everything you will build. Creating one now means your app, table, flow, and environment variable will all be packaged together for deployment.

  • In the Power Apps maker portal, select Solutions in the left navigation pane.
  • If you do not see Solutions in the side panel, select ...More and then select Solutions.
  • Select New solution on the command bar.
  • Enter Emergency Deployment Tracker in the Display name field.
  • Select a Publisher for the solution. The default publisher is fine for this project.
  • Leave the Version as 1.0.0.0.
  • Select Create.

Your new solution opens automatically. You will add all project components here.

What is a solution?

A solution in Power Platform is a package that holds tables, apps, flows, and other components together. It makes your work portable across environments and supports proper application lifecycle management (ALM).

Don't see the New solution button?

Make sure you are in an environment that has a Dataverse database provisioned. You also need the Environment Maker or System Administrator role. If the button is greyed out, switch to your Dataverse-enabled environment using the environment picker in the top-right corner of the maker portal.

Help me figure out why I can't create a solution in Power Apps.

Create the Emergency Deployment table

This custom table stores deployment records that field personnel submit from the app. Each row represents one deployment event with status, location, and timestamp information.

  • Inside your Emergency Deployment Tracker solution, select New on the command bar.
  • Select Table, then select Table again (the standard table option).
  • In the Display name field, enter Emergency Deployment.
  • The Plural name auto-fills. Leave it as the default.
  • Select Save. The table is created and the table designer opens.

You now have a table with a default primary column called Name. You will rename this and add the remaining columns next.

Why create the table inside the solution?

When you create a table directly from within a solution, it automatically inherits the solution publisher's prefix and is tracked as a solution component. This means it travels with the solution when you export and import to other environments.

  • In the table designer, select the Columns area.
  • Select the default Name column (the primary column).
  • In the properties pane on the right, change the Display name to Personnel Name.
  • Select Save.

Now add the four remaining columns one at a time.

  • Select + New column (or New > Column from the command bar).
  • Set Display name to Deployment Status.
  • Set Data type to Choice.
  • Under Choice, select New choice.
  • Add four options: Deployed, In Transit, On Standby, and Returned.
  • Select Save to save the column.

How do I add multiple choice options?

After selecting New choice, you will see a text field with a default option. Replace the default text with Deployed. Then select + New choice (or Add new item) to add each additional option. Repeat until all four values are listed.

  • Add a second column with Display name set to Location and Data type set to Single line of text. Save the column.
  • Add a third column with Display name set to Deployment Timestamp and Data type set to Date and time. Save the column.
  • Add a fourth column with Display name set to Notes and Data type set to Multiple lines of text. Save the column.

Your table now has five columns: Personnel Name, Deployment Status, Location, Deployment Timestamp, and Notes.

Column not saving?

Make sure you select Save (or Done) after configuring each column's properties. If the save button is greyed out, check that the Display name field is not empty and the data type is selected.

Help me troubleshoot why my Dataverse column is not saving.

Add sample rows and verify the table in the solution

Adding sample data lets you confirm the table structure is correct before connecting it to the app.

  • In the table designer, select the Data tab (or select View data on the command bar if available).
  • Select + New row to create a sample record.
  • Enter a value in each column. For example: Personnel Name = J. Martinez, Deployment Status = Deployed, Location = Topeka, KS, Deployment Timestamp = today's date, Notes = Initial deployment for flood response.
  • Add at least one more row with different values so you can see multiple records.
  • Press Tab or click outside the row to save each entry.

You should see your sample rows displayed in the data grid with correct values in every column.

  • Navigate back to the solution by selecting Solutions in the left navigation, then opening Emergency Deployment Tracker.
  • Confirm the Emergency Deployment table appears in the solution's Objects list.

What should I see?

In the solution view, you should see the Emergency Deployment table listed as a component. Opening it shows your five columns and the sample rows you entered. This confirms everything is tracked inside the solution and will travel with it to other environments.

Table not showing in the solution?

If you created the table from the Tables area (outside the solution) instead of from within the solution, it will not appear automatically. Open your solution, select Add existing > Table, find Emergency Deployment, select Include all objects, and select Add.

Help me add an existing Dataverse table to my solution.

Your foundation is in place. Next up, you will build the responsive Canvas App that connects to this table and lets field personnel submit deployments from any device.

Build the Responsive Canvas App with Modern Controls

Your solution and Dataverse table are ready. Now it's time to build the interface that field personnel will actually use.

In this step, you'll create a responsive Canvas App using Fluent UI Modern Controls. The app needs to work on both tablets and phones since emergency workers carry different devices in the field.

In this step, get ready to:
  • Create a Canvas App inside your solution and enable Modern Controls.
  • Configure responsive layout with auto-layout containers.
  • Build a deployment form and connect it to Dataverse via Patch().
Create the Canvas App and enable Modern Controls

Modern Controls are built on the Microsoft Fluent 2 design system. They provide improved accessibility, touch-friendly defaults on mobile, and consistent styling across your app.

  • In the Power Platform maker portal, return to your Emergency Deployment Tracker solution.
  • Click + New in the command bar.
  • Select App, then Canvas app.
  • Enter Emergency Deployment Tracker as the app name.
  • Select Tablet as the format, then click Create.

Power Apps Studio opens with a blank canvas. Next, enable Modern Controls.

  • Click Settings in the command bar (gear icon).
  • Select the Updates tab.
  • Select the New sub-tab.
  • Toggle on Modern controls and themes.
  • Close the Settings panel.

What are Modern Controls?

Modern Controls follow Microsoft's Fluent 2 design system. They automatically apply touch-friendly defaults on mobile layouts, including larger tap targets and 24pt font sizes.

Once enabled, you'll see modern versions of buttons, text inputs, dropdowns, and more in the control insert panel. Classic controls remain available under separate categories.

Don't see the Modern controls and themes toggle?

Make sure you're on the New sub-tab under Updates, not the General or Retired tabs. The toggle only appears on the New tab.

Help me find the Modern Controls toggle in Settings.

Configure responsive layout with auto-layout containers

By default, Canvas Apps use fixed positioning. Disabling Scale to fit lets the app adapt its layout to the actual screen size instead of simply stretching a fixed design.

  • Open Settings again from the command bar.
  • Select Display.
  • Toggle off Scale to fit.
  • Close the Settings panel.

Why disable Scale to fit?

With Scale to fit enabled, Power Apps stretches your fixed layout to fill the device screen. This causes elements to warp on different screen sizes.

Disabling it activates true responsive behavior. Combined with auto-layout containers, your app reflows its content based on available space. This also automatically turns off Lock aspect ratio.

Now build the two-screen layout structure using containers.

  • On Screen1 (the default screen), delete any controls that were auto-inserted.
  • Click + Insert in the left panel, then search for Vertical container.
  • Insert a Vertical container. This becomes your main page layout container.
  • Set the container's Width to Parent.Width and Height to Parent.Height in the properties panel so it fills the screen.
  • Inside that vertical container, insert a Horizontal container for the header area.
  • Below the header container, insert another Vertical container for the form content area.
  • Add a second screen by clicking + New screen in the left panel's screen list.
  • Name it scrWeatherAlerts (you'll build this out in a later step).

You now have a two-screen app with a responsive container structure on the first screen.

Rename your screens and containers

Rename Screen1 to scrDeploymentForm and give your containers descriptive names like conMain, conHeader, and conFormBody. Clear naming makes formulas easier to read and maintain.

Build the deployment form and connect to Dataverse

The form needs to capture all five columns from your Emergency Deployment table. You'll use Modern Controls for the inputs and wire a Submit button to Patch() to write records directly to Dataverse.

  • First, add the Emergency Deployment table as a data source. Click the Data icon in the left panel (cylinder icon).
  • Click + Add data, search for Emergency Deployments, and select it.

Now add the form controls inside your form body container on the deployment form screen.

  • Click inside your form body container, then click + Insert.
  • Insert a Modern Text input control. Rename it to txtPersonnelName and set its Placeholder to Enter personnel name.
  • Insert a Modern Dropdown control. Rename it to drpDeploymentStatus.
  • Insert a Modern Date picker control. Rename it to dpTimestamp.
  • Insert another Modern Text input control. Rename it to txtLocation and set its Placeholder to Enter location.
  • Insert one more Modern Text input control. Rename it to txtNotes, set its Type property to TextInputType.Multiline, and set its Placeholder to Enter notes.
  • Insert a Modern Button control. Rename it to btnSubmit and set its Text property to Submit Deployment.

Now configure the Dropdown to show your Deployment Status choices from Dataverse.

  • Select the drpDeploymentStatus control.
  • Set its Items property to the following formula:
Choices('Emergency Deployments'.'Deployment Status')

What does this formula do?

The Choices() function retrieves all available options from a Dataverse Choice column. This populates the dropdown with Deployed, In Transit, On Standby, and Returned without you hard-coding them.

Finally, wire the Submit button to write a new record to the table.

  • Select the btnSubmit control.
  • Set its OnSelect property to the following formula:
Patch(
    'Emergency Deployments',
    Defaults('Emergency Deployments'),
    {
        'Personnel Name': txtPersonnelName.Text,
        'Deployment Status': drpDeploymentStatus.Selected,
        'Deployment Timestamp': dpTimestamp.SelectedDate,
        Location: txtLocation.Text,
        Notes: txtNotes.Text
    }
);
Notify("Deployment submitted successfully", NotificationType.Success);
Reset(txtPersonnelName);
Reset(drpDeploymentStatus);
Reset(dpTimestamp);
Reset(txtLocation);
Reset(txtNotes)

What does this formula do?

Patch() creates a new row in the Emergency Deployments table. Defaults() tells Power Apps you're creating a new record (not updating an existing one).

Each line inside the curly braces maps a form control's value to a Dataverse column. For example, txtPersonnelName.Text reads whatever the user typed into the personnel name field.

After patching, Notify() shows a success banner and Reset() clears each control back to its default state so the form is ready for the next entry.

  • Click the Play button (triangle icon in the top-right) to preview the app.
  • Fill in all fields on the form with test data and click Submit Deployment.
  • You should see a green success notification banner at the top of the app, and the form fields reset to empty.
  • Press Esc or click the X to exit preview mode.
  • Verify the new row landed in Dataverse by opening the Data panel on the left, clicking the three dots next to Emergency Deployments, and selecting Edit data. Your test record should appear in the table.

Form submits but no row appears in the table?

Check that the column names in your Patch formula exactly match your Dataverse table column display names (including spaces). For example, 'Personnel Name' must have the single quotes because it contains a space.

Also confirm you added Emergency Deployments as a data source in the Data panel. Without the data connection, the Patch formula has nowhere to send the record.

Help me troubleshoot why Patch() isn't creating a row in my Dataverse table.

Now test responsive behavior.

  • In Power Apps Studio, click the device preview dropdown in the top bar (it shows your current preview size).
  • Switch between Tablet and Phone preview sizes.
  • Your auto-layout containers should reflow the form controls to fit each size cleanly. The controls stack vertically on narrower phone layouts.
  • Save the app by pressing Ctrl+S (Windows) or Cmd+S (macOS).

Why do Modern Controls resize automatically?

Modern Controls on mobile layouts automatically apply touch-friendly defaults. This includes larger widths and heights, larger font sizes (typically 24pt), and appropriate padding and spacing. You get responsive behavior without manually setting breakpoints for each control.

✔️ Awesome, I've got everything!

Great. Double check you've saved your app and that you can see your test record in the Dataverse table.

ⓧ I'd like to double check the full code

Here are the key formulas you should have configured:

drpDeploymentStatus Items property:

Choices('Emergency Deployments'.'Deployment Status')

btnSubmit OnSelect property:

Patch(
    'Emergency Deployments',
    Defaults('Emergency Deployments'),
    {
        'Personnel Name': txtPersonnelName.Text,
        'Deployment Status': drpDeploymentStatus.Selected,
        'Deployment Timestamp': dpTimestamp.SelectedDate,
        Location: txtLocation.Text,
        Notes: txtNotes.Text
    }
);
Notify("Deployment submitted successfully", NotificationType.Success);
Reset(txtPersonnelName);
Reset(drpDeploymentStatus);
Reset(dpTimestamp);
Reset(txtLocation);
Reset(txtNotes)

Control names and settings:

  • txtPersonnelName (Modern Text Input, SingleLine).
  • drpDeploymentStatus (Modern Dropdown, Items bound to Choices).
  • dpTimestamp (Modern Date Picker).
  • txtLocation (Modern Text Input, SingleLine).
  • txtNotes (Modern Text Input, Multiline).
  • btnSubmit (Modern Button, Text = "Submit Deployment").

Your responsive Canvas App is live with a working deployment form. Next up, you'll enable offline mode so the app keeps working when field personnel lose connectivity.

Enable Offline Mode with an Offline Profile

Your deployment form now writes data to Dataverse, but emergency personnel often work in areas with unreliable connectivity.

In this step, you will enable the built-in offline-first capability so that the app downloads deployment data to the device and continues working without a network connection. Power Apps handles syncing automatically when connectivity returns.

In this step, get ready to:
  • Enable offline mode and create a new offline profile.
  • Configure the profile to sync the Emergency Deployment table filtered to the current user's rows.
  • Add the offline status template screen and verify the sync indicator.
Turn on the offline capability in your app

The built-in offline feature stores a local copy of your Dataverse data on the device. Once enabled, the app always runs offline-first. It reads from the local database and syncs changes when a network is available.

  • In Power Apps Studio, open your Emergency Deployment Tracker Canvas App for editing (it should already be open from the previous step).
  • Click Settings in the top menu bar.
  • Select the General tab on the left.
  • Toggle Can be used offline to On.

What does enabling offline do?

When you flip this toggle, Power Apps converts your app into an offline-first experience. Data defined in the offline profile downloads to the device on first open. After that, the app reads exclusively from local storage.

Power Apps automatically syncs local changes back to Dataverse when connectivity returns. It also handles conflict detection and delta syncs (only changed data is transferred).

  • In the Select offline profile dropdown that appears, select New profile with app data.

Why a new profile instead of the autogenerated one?

The autogenerated profile downloads all rows the user has permission to see, with no filters applied. For an emergency deployment app with potentially thousands of records across an organization, that is wasteful and slow.

A custom profile lets you filter data to only the current user's rows and set a sync interval, keeping the device lean and sync times fast.

A new page based on the Offline template is automatically inserted into your app. You will explore it shortly.

Configure the offline profile with a table filter and sync interval

The offline profile editor opens and displays Data available offline. Here you add the Emergency Deployment table and restrict which rows download to the device.

  • In the Data available offline section, click Add table.
  • Search for and select Emergency Deployment.
  • Click Next.
  • Under the row filter options, select Organization rows.
  • Check User's rows to limit the offline data to only rows owned by the current user.
  • Set the Sync interval to a frequency appropriate for field work. A value of 30 minutes works well for deployment updates that change infrequently.
  • Click Save.

What does the sync interval control?

The sync interval defines how often the device checks Dataverse for updated rows when online. It can range from 5 minutes (frequent updates) to 1440 minutes (once per day). For emergency deployments that change status periodically but not every minute, 30 minutes balances freshness with battery and bandwidth usage.

  • Close the Settings window.
  • Click Save in the top-right to save your app.

Don't see the Can be used offline toggle?

This toggle only appears for apps that are inside a solution. Confirm that your Canvas App was created inside the Emergency Deployment Tracker solution. If it was created outside the solution, you will need to add it to the solution first.

You also need the Environment Maker, System Administrator, or System Customizer role to set up offline mode.

Why can't I see the offline toggle in my app settings?

Verify the offline status screen and test the indicator

When you enabled offline, Power Apps automatically inserted a page based on the Offline template. This page contains a globe icon driven by the Connection.Sync Power Fx function that reflects the app's current sync state.

  • In the left Tree view panel, locate the new Offline screen that was added automatically.
  • Click on the globe icon in the navigation bar area of that screen.
  • In the Properties pane on the right, confirm the Icon property references Connection.Sync to display different globe icons depending on connectivity.
  • Confirm the OnSelect property is set to ShowHostInfo(HostInfo.OfflineSync) so tapping the icon opens the Device Status page on mobile.

How does Connection.Sync work?

The Connection.Sync function returns an enum value representing the current sync state. Possible values include Connected, ConnectedRefresh (actively syncing), ConnectedPendingUpsync (local changes waiting to upload), NotConnected, and error states.

The globe icon uses a Switch formula to map each enum value to a different icon. Users can instantly tell whether the device is connected, syncing, or offline.

  • Click Save and then Publish to make the app available on mobile.
  • Open the published app on your mobile device using Power Apps Mobile.
  • Wait for the initial offline sync to complete. A message tells you the app is syncing data and shows the number of rows being downloaded.
  • Once the sync finishes, enable Airplane mode on your device to simulate a field scenario with no connectivity.
  • Navigate to the deployment form and confirm that your previously synced deployment records are still accessible.
  • Check the globe icon. It should display the Not Connected state.

What should I see?

With airplane mode enabled, the globe icon changes to indicate the device is not connected. Your sample deployment records from the Dataverse table remain fully accessible because they were downloaded during the initial sync.

If you submit a new deployment record while offline, it queues locally and syncs automatically when you turn airplane mode off.

Records not showing while offline?

Make sure the initial sync completed before you enabled airplane mode. The first sync downloads all data in the offline profile and may take a few minutes.

Confirm that the sample rows in your Emergency Deployment table are owned by your user account. The User's rows filter only downloads records where you are the owner.

Help me troubleshoot why my offline data isn't appearing on mobile.

Why can't I use Power Automate flows offline?

Power Automate flows are not supported in offline mode. This makes sense because flows call external APIs that require an active internet connection. Your weather alerts flow (built in the next step) will only work when the device is online.

The offline profile handles only Dataverse data reads and writes. Any feature that depends on external connectivity must gracefully degrade when the device is disconnected.

Your app now works offline-first. Deployment records sync to the device, stay accessible without connectivity, and upload changes automatically when back online. Next up, you will build a Cloud Flow that pulls real-time weather alerts from the NWS API and wire it into the app.

Create the Weather Alerts Cloud Flow with an Environment Variable

Your app can now log deployments offline and sync when connectivity returns. The next challenge is giving field workers real-time awareness of active weather threats in their deployment area.

To do this, you will build a Cloud Flow that calls the National Weather Service alerts API. Instead of hardcoding the API URL directly in the flow, you will store it in an environment variable. This makes the solution portable across environments (e.g. Gov-Dev vs Gov-Prod) without editing flow logic.

In this step, get ready to:
  • Create a Text-type environment variable to store the NWS API base URL.
  • Build an Instant Cloud Flow with the Power Apps (V2) trigger that accepts a state code input.
  • Call the NWS alerts endpoint and return alert data to the calling app.
Create the NWS_API_BaseURL environment variable

Environment variables let you store configuration values (like API URLs) at the solution level. When you deploy the solution to a different environment, you override the variable value without touching the flow itself.

  • Return to your solution in the Power Apps maker portal.
  • In the solution command bar, select + New > More > Environment variable.
  • Set the Display name to NWS_API_BaseURL.
  • Set the Data Type to Text.
  • In the Default Value field, enter https://api.weather.gov.
  • Click Save.

What is an environment variable?

An environment variable is a solution component that stores a configurable value. When you move the solution between environments (Dev, Test, Prod), each environment can supply its own value without modifying the flow or app that references it.

Here you are using a Text-type variable for a URL. Power Platform also supports Decimal, JSON, Data source, and Secret types (Secret requires Azure Key Vault).

  • Verify the environment variable appears in your solution's component list with the value https://api.weather.gov.

Don't see Environment variable in the menu?

Make sure you are clicking + New from inside your solution, not from the top-level maker portal. Environment variables are solution-aware components and only appear in the solution context.

help me find where to create an environment variable in my Power Platform solution

Create the GetWeatherAlerts Cloud Flow with the Power Apps (V2) trigger

The flow will accept a state code from the Canvas App, call the NWS alerts API, and return the results. Using the Power Apps (V2) trigger lets you define typed inputs and outputs that Power Apps can consume directly.

  • Inside your solution, select + New > Automation > Cloud flow > Instant.
  • Name the flow GetWeatherAlerts.
  • Under Choose how to trigger this flow, select Power Apps (V2).
  • Click Create.

The flow designer opens with the Power Apps (V2) trigger already in place.

  • In the trigger card, select + Add an input.
  • Choose Text as the input type.
  • Name the input StateCode.

Why Power Apps (V2) instead of the legacy trigger?

The Power Apps (V2) trigger lets you explicitly define typed input parameters with names you control. The legacy trigger auto-generates parameter names based on the actions that reference them, which makes formulas harder to read.

With V2, your Canvas App calls the flow using a clean syntax like GetWeatherAlerts.Run("KS") and gets typed outputs back.

Add the HTTP action and response action to complete the flow

Now you will add two actions: an HTTP action that calls the NWS alerts endpoint, and a response action that sends the data back to Power Apps.

  • Below the trigger, select the + (plus sign), then select Add an action.
  • Search for HTTP and select the built-in HTTP action.
  • Set the Method field to GET.
  • Click inside the URI field, then select the lightning bolt icon to open the Dynamic content list.
  • Search for and select the NWS_API_BaseURL environment variable from the list.
  • After the inserted token, type /alerts/active?area= directly in the field.
  • Open the Dynamic content list again and select the StateCode input from the trigger outputs.

Your completed URI field reads: [NWS_API_BaseURL] token, then /alerts/active?area=, then the [StateCode] token.

  • Expand the Headers section of the HTTP action.
  • Add a header with key User-Agent and value EmergencyDeploymentApp.

Why does the NWS API need a User-Agent header?

The National Weather Service API is free and does not require an API key. It does require a User-Agent header to identify the calling application. This string can be anything that describes your app.

Now add the response action so the flow can send data back to Power Apps.

  • Below the HTTP action, select + > Add an action.
  • Search for Respond to a PowerApp or flow and select it.
  • In the Respond action, select + Add an output.
  • Choose Text and name the output AlertHeadline.
  • In the value field for AlertHeadline, switch to the Expression tab and enter the following expression:
body('HTTP')?['features']?[0]?['properties']?['headline']
  • Add another output. Choose Text and name it AlertSeverity.
  • In the value field for AlertSeverity, switch to the Expression tab and enter this expression:
body('HTTP')?['features']?[0]?['properties']?['severity']
  • Click Save in the command bar to save your flow.

What do these expressions do?

The NWS alerts API returns a GeoJSON response. The features array contains individual alert objects. Each alert has a properties object with fields like headline and severity.

The expressions use the safe navigation operator (?) to avoid errors when no alerts are active. If the array is empty, the output returns null instead of failing the flow.

Now test the flow to confirm it calls the NWS API and returns data correctly.

  • In the flow designer, select Test in the top-right corner.
  • Choose Manually, then click Test.
  • When prompted for the StateCode input, enter KS (Kansas frequently has active weather alerts).
  • Click Run flow.

After the flow completes, expand each action to inspect the outputs. The HTTP action should return a 200 status code. The Respond action should show values in AlertHeadline and AlertSeverity (or null if no alerts are currently active for that state).

Flow run failed or returned an error?

If the HTTP action shows a 403 or connection error, check that your User-Agent header is present. The NWS API rejects requests without it.

If the environment variable token did not resolve, confirm that NWS_API_BaseURL has a default value set. Environment variables without a current or default value resolve to empty.

help me troubleshoot why my GetWeatherAlerts Cloud Flow is failing when I test it

Your Cloud Flow is live and tested. Next up, you will connect this flow to your Canvas App so field workers can check weather alerts directly from the deployment screen.

Integrate the Cloud Flow into the App

Your deployment form captures field data, and your offline profile keeps it accessible without connectivity. The next piece is bringing live external data into the app.

The GetWeatherAlerts Cloud Flow you built in the previous step already calls the NWS API and returns alert data. In this step, you'll connect that flow to your Canvas App and build a dedicated screen where emergency personnel can check real-time weather alerts by state.

In this step, get ready to:
  • Add the GetWeatherAlerts flow to the app and build a Weather Alerts screen.
  • Wire a button to call the flow and capture its response.
  • Display alert data and confirm the action with a notification.
Connect the Cloud Flow and build the Weather Alerts screen

Before the app can call your flow, you need to register it inside the Canvas App using the Power Automate pane. Then you'll set up the screen's controls for state selection and triggering the flow.

  • Return to your Canvas App in Power Apps Studio.
  • In the app authoring menu on the left, select Power Automate to open the Power Automate pane.
  • In the pane, select Add a flow.
  • Select GetWeatherAlerts from the list. It appears because both the flow and the app are in the same solution and the flow uses a Power Apps trigger.
  • Confirm the flow now appears under the In your app section of the Power Automate pane.

Why add the flow through this pane?

Registering the flow via the Power Automate pane creates a reference inside the app. This is what lets you call GetWeatherAlerts.Run() from your formulas. Without this step, the app has no way to discover or invoke the flow.

  • In the Tree view on the left, select the placeholder screen (Screen2) you created earlier.
  • Rename it to scrWeatherAlerts by double-clicking its name in the tree view and typing the new name.
  • With the screen selected, insert a Vertical container from the Insert menu to hold your controls.
  • Inside the container, insert a Modern Dropdown control.
  • Rename the dropdown to drpState in the tree view.
  • Set the dropdown's Items property to the following formula:
["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"]

What does this formula do?

This inline array provides all 50 US state abbreviation codes as selectable options. The NWS alerts endpoint expects a two-letter state code as input, so these map directly to valid API parameters.

  • Below the dropdown, insert a Modern Button control.
  • Set the button's Text property to "Get Alerts".

Save the app. Your Weather Alerts screen now has a dropdown for state selection and a button ready to trigger the flow.

Don't see the flow in the list?

The flow must have a Power Apps (V2) trigger and live in the same solution as the app. If GetWeatherAlerts does not appear under Add a flow, verify both components are in the Emergency Deployment Tracker solution.

Help me connect my Cloud Flow to the Canvas App.

Wire the button to call the flow

The button's OnSelect formula is where you invoke the flow and capture its response in a variable. This single line sends the selected state code to the flow and stores the returned alert data.

  • Select the Get Alerts button on the canvas.
  • In the property dropdown at the top-left of the formula bar, select OnSelect.
  • Enter the following formula in the formula bar:
Set(varAlerts, GetWeatherAlerts.Run(drpState.Selected.Value));
Notify("Weather alerts retrieved", NotificationType.Success)

What does this formula do?

GetWeatherAlerts.Run(drpState.Selected.Value) calls the Cloud Flow and passes the selected state abbreviation as the StateCode input. The Set() function stores the flow's response (headline and severity) in a variable called varAlerts.

Notify() displays a brief toast banner confirming the action completed. This gives the user immediate feedback while the alert data populates below.

Why does this only work online?

Power Automate flows are not supported in offline mode. The weather alerts feature only works when the device has connectivity. This correctly models real-world behavior because you cannot call an external API without a network connection.

Save the app. The button is now wired to call the flow when pressed.

Seeing a formula error in the bar?

Confirm the dropdown is named exactly drpState in the tree view. Power Fx control references are case-sensitive and must match the control name exactly.

Also verify the flow appears under In your app in the Power Automate pane. If it is missing, the formula cannot resolve GetWeatherAlerts.

Help me fix my OnSelect formula for the Cloud Flow button.

Display alert data on the screen

The flow's response is now stored in varAlerts. You need to display the headline and severity to the user, and handle the case where no active alerts exist for the chosen state.

  • Below the button, insert a Text (label) Modern Control.
  • Set the label's Text property to the following formula:
If(
    IsBlank(varAlerts),
    "Select a state and press Get Alerts",
    If(
        IsBlank(varAlerts.alertheadline),
        "No active alerts for this state",
        "Headline: " & varAlerts.alertheadline & Char(10) & "Severity: " & varAlerts.alertseverity
    )
)

What does this formula do?

The outer If() checks whether the user has pressed the button yet. If varAlerts is blank, it shows a placeholder prompt.

The inner If() handles the scenario where the flow ran but no active alerts exist for that state. When alert data is present, it displays the headline and severity separated by a line break (Char(10)).

  • Save the app.
  • Press F5 (or click the Play button in the top-right) to preview the app.
  • Select a state from the drpState dropdown (try KS since you tested the flow with that earlier).
  • Press the Get Alerts button.
  • Verify that the notification toast appears and the label displays either alert data or the "No active alerts" message.
  • Press Esc or the X icon to exit preview mode.

Button press does nothing?

Cloud Flows require an active internet connection. Make sure you are online and not in offline preview mode.

If the notification appears but the label stays at the placeholder text, the flow may be returning empty values. Check the flow's run history in Power Automate to confirm the "Respond to a PowerApp or flow" action is returning alertheadline and alertseverity outputs.

Help me debug my Weather Alerts screen.

✔️ Awesome, I've got everything!

Great. Make sure you've saved your app before moving on.

ⓧ I'd like to double check the full setup

Here is a summary of all the key properties you configured on the Weather Alerts screen:

  • drpState (Modern Dropdown): Items = the inline array of 50 state codes.
  • Button (Get Alerts): OnSelect = Set(varAlerts, GetWeatherAlerts.Run(drpState.Selected.Value)); Notify("Weather alerts retrieved", NotificationType.Success).
  • Text label: Text = If(IsBlank(varAlerts), "Select a state and press Get Alerts", If(IsBlank(varAlerts.alertheadline), "No active alerts for this state", "Headline: " & varAlerts.alertheadline & Char(10) & "Severity: " & varAlerts.alertseverity)).
  • GetWeatherAlerts flow is listed under In your app in the Power Automate pane.

Your app now pulls real-time weather data from the National Weather Service directly into the hands of emergency personnel. Next up, you'll extend the app with a deployment history gallery in the Secret Mission.

Secret mission

Add a Deployment History Gallery with Status Filtering

Your app can create deployments, but field coordinators need a quick way to review past deployments by status. In this secret mission, you'll add a Deployment History screen with a Modern Table control that filters by status and automatically adapts its layout between tablet and mobile widths.

Clean Up Your Resources

Clean Up Your Resources

Your Power Apps Premium license is a recurring $20/month charge. This project is part of a three-project series, so decide whether to keep your resources for Project 2 (security hardening) or clean up now.

Cost warning

Your Power Apps Premium license costs $20/user/month. Keep it active through all three projects in this series. If you cancel after completing the series, your environments and data persist but become inaccessible until re-licensed.

Resources you used:

  • Dataverse solution containing the Emergency Deployment table, Canvas App, Cloud Flow, and environment variable.
  • Power Apps Premium license ($20/user/month) covering Dataverse, Cloud Flows triggered from apps, and all premium features used across the three-project series.
  • Cloud Flow runs counting against your daily Power Platform request limits (generous allocation included with Premium).

Keep everything running

No action needed. Choose this if you are continuing to Project 2 (security hardening) in this series.

  • Leave the solution and all its components in place.
  • Keep your Power Apps Premium license active.
  • The Cloud Flow only runs when triggered from the app, so it does not consume request limits while idle.

Pause - I'll come back to this later

Turn off the Cloud Flow to prevent any accidental API calls. Do not cancel the license mid-series.

  • Open the Power Apps maker portal at make.powerapps.com.
  • Select Solutions in the left navigation pane, then open your solution.
  • Select the GetWeatherAlerts Cloud Flow inside the solution.
  • Select the vertical ellipsis (⋮), then select Turn off.
  • Keep your Power Apps Premium license active so your environment remains accessible when you return.

Delete - I don't want to use this again

Remove all project components and optionally cancel your license. Only cancel the Premium license after completing all three projects in the series.

Because the solution you created is unmanaged, deleting the solution container alone does not remove its components. You need to delete each component from the environment individually, then delete the solution container.

  • Open the Power Apps maker portal at make.powerapps.com.
  • Select Solutions in the left navigation pane, then open your solution.
  • Select the Canvas App (Emergency Deployment Tracker), then select Delete from this environment on the command bar.
  • Select the Cloud Flow (GetWeatherAlerts), then select Delete from this environment on the command bar.
  • Select the Emergency Deployment table, then select Delete from this environment on the command bar. This permanently removes the table and all its data.
  • Select the NWS_API_BaseURL environment variable, then select Delete from this environment on the command bar.
  • Return to the Solutions list. Select (do not open) the now-empty solution, then select Delete on the command bar.
  • To cancel your Power Apps Premium license after completing all three projects, go to the Microsoft 365 admin center and navigate to Billing then Your products. Select the Power Apps Premium subscription and follow the cancellation steps.

Nice Work!

Nice Work!

You just built a production-ready, offline-capable emergency deployment app from scratch. The app connects to live weather data, works without connectivity, and lives inside a portable solution ready for the next phase of hardening.

You've learned how to:

  • Build a responsive Canvas App using Fluent UI Modern Controls and auto-layout containers that adapts between tablet and mobile form factors.
  • Enable built-in offline-first capability with a Dataverse offline profile and sync indicator, so your app works without connectivity.
  • Integrate a Cloud Flow using the Power Apps (V2) trigger that calls the NWS weather alerts API and returns live data into the app, with an environment variable for ALM-portable configuration.
  • Secret Mission: Added a deployment history gallery with status filtering and responsive table behavior using the Modern Table control's ReflowBehavior.

Ready to quiz yourself?