Set up mobile offline for canvas apps (preview)

[This article is prerelease documentation and is subject to change.]

Turn on offline mode in your canvas app if users need to work without worrying about their Internet connection.

Important

Preview features aren’t meant for production use and may have restricted functionality. These features are available before an official release so that customers can get early access and provide feedback.

This feature is in the process of rolling out and may not be available in your region yet.

Prerequisites

  • You must have version 3.23052 or later of Power Apps Studio and version 3.23053 or later of the Power Apps mobile app.

  • The canvas app must be in a solution.

  • The canvas app must use Dataverse data only.

  • You must have the Environment Maker, System Administrator, or System Customizer role to set up offline mode for canvas apps. These roles have create, read, write, delete, and share privileges on the Mobile offline profile table. Learn about predefined security roles.

  • Users with the Basic User role can open and use an offline application. This role has read privilege on the Mobile offline profile table.

  • If you have a custom security role, make sure it grants read privilege on the Mobile offline profile table. Learn about miscellaneous privileges.

Optimize your app for mobile offline

Mobile apps run on small screens with limited connectivity. Before you set up offline mode, make sure your canvas app is optimized for offline and mobile use. Consider the user scenarios you want to cover and the amount of data the app uses. Create an app that's simple and lightweight.

Follow these best practices when you build an app for mobile offline use:

  • Identify the on-the-go scenarios that are functionally related, such as tasks that are performed by users who work in the field.

  • Reduce the complexity of your app by limiting the number of tables that need to be downloaded. Sometimes it's better to have two apps instead of one.

  • Use views that are optimized for the experience rather than displaying a large set of data. For example, it's preferable to use the My active accounts view, rather than the All accounts view.

Turn on offline capability for tables

Tables that your offline-first app uses must have offline capability turned on. Some built-in tables have it by default. Some tables can't be used offline. However, you can turn on offline capability for any new, custom table.

  1. Sign in to Power Apps.

  2. In the left side panel, select Tables.

  3. Select a table, and then select Edit.

  4. Select Edit table properties.

  5. Select Advanced options, and then scroll to the Rows in this table section.

  6. Select Can be taken offline.

    Screenshot of the table editing options, with **Can be taken offline** highlighted.

  7. Select Save.

Turn on offline capability for your app

  1. In Power Apps studio, in the left side panel, select Apps.

  2. Select your canvas app, and then select Edit.

  3. Select Settings.

  4. Select Upcoming features, and then select the Experimental tab.

  5. Turn on the Dataverse offline option.

  6. Select General.

  7. Turn on the Can be used offline option.

  8. Select an offline profile. You have two options:

    • Use an autogenerated profile. This setting downloads the tables that are used in your app and is the recommended option.

    • Create a custom profile, select the Refresh icon to see your new profile in the list, and then select it.

      Screenshot of app settings, with the Can be used offline option and offline profile list highlighted.

      If you don't see the Can be used offline option, make sure the app is in a solution.

  9. Close the Settings window, and then save and publish your app.

A page that's based on the Offline template is automatically inserted in the app. The page contains an icon that uses the Connection Power Fx function to reflect the app's offline sync status. You can use it as-is or customize it, as appropriate.

Note

If you're turning on offline capability for a brand-new canvas app, make sure the default first screen is based on the Offline template.

Create a mobile offline profile

If the automatically generated offline profile doesn't meet your needs, create your own. Learn about guidelines for offline profiles.

You need to publish your new offline profile before you can select it in your canvas app's settings. If you edit and publish an offline profile, you must also publish any canvas apps that use it.

Create an offline profile (with admin rights)

  1. Sign in to the Power Platform admin center using an admin account.

  2. In the left side panel, select Environments.

  3. Select an environment, and then select Settings.

  4. Expand Users + permissions, and then select Mobile configuration.

  5. Select Create new profile.

  6. Enter a name and description, and then select Create.

  7. After the profile is created, select it to continue editing it.

  8. In the Data available offline section, select Add table.

  9. Select a table from the list. Only tables that can be set for offline use appear in the list.

  10. Select Next.

  11. Select a filter based on the table's ownership type.

    Table ownership type Available filter options for data download
    User or team
    • Download related rows only: Make the table's related data available offline. If you don't set any relationships, no rows in this table are available.

    • All rows: Make all rows in this table available offline.

    • Other data filter: Make only the specified rows in this table available offline. Select from the following options:

      • Download user rows: Make only your rows available offline.

      • Download team rows: Make your team's rows available offline.

      • Download my business unit's rows: Make your business unit's rows available offline.

    Organization
    • Download related rows only: Make the table's related data available offline. If you don't set any relationships, no rows for this table are available.

    • All rows: Make all rows in this table available offline.
    Business
    • Download related data only: Make the table's related data available offline. If you don't set any relationships, no rows for this table are available.

    • All rows: Make all rows in this table available offline.

    • Other rows: Make only the specified rows in this table available offline. Select the following option:

      • Download my business unit's rows: Make your business unit's rows available offline.
    None
    • Download related rows only: Make the table's related data available offline. If you don't set any relationships, no rows for this table are available.

    If you select Custom, you can define a custom filter up to three levels deep with the following rules.

    Rules    
    equal not equal gt – greater than
    ge – greater than or equal to le – less than or equal to lt – less than
    like not-like in
    not-in null not-null
    eq-userid ne-userid eq-userteams
    eq-useroruserteams eq-useroruserhierarchy eq-useroruserhierarchyandteams
    eq-businessid ne-businessid eq-userlanguage
    begins-with not-begin-with ends-with
    not-end-with
  12. In the Include [table name] records related to these tables section, select the related table relationships. You must have added the table that you want to create the relationship with. For example, if you want to add a relationship between the Account and Contact tables, then you need to add both tables to the mobile offline profile.

    For example, if you select Contact | Field name: Primary Contact, then for every contact, the system also downloads the account that's related to it.

    Screenshot of edit options for the Account table, with Include Account records related to these tables highlighted.

  13. Select Save.

Create an offline profile (without admin rights)

If your Power Apps account doesn't have admin rights, you can still create a mobile offline profile. Coming soon, you'll be able to create an offline profile directly in Power Apps Studio. Until then, use this workaround.

  1. Create a model-driven app in your test environment that uses the same tables as your canvas app.
  2. Set up the model-driven app for offline use.
  3. Generate a default profile and add tables with filters.
  4. Publish the model-driven app.
  5. Select the offline profile in your canvas app.

Create an offline canvas app

To make it easier to create or convert a canvas app for offline use, we created the Offline template. The template includes a globe icon in the navigation bar that shows the connectivity and sync state, putting offline at the center of the experience. Users always know whether their device and data are ready to go.

A new page created from the Offline template is automatically inserted as soon as you turn on the offline capability in your canvas app.

Screenshot of a page based on the Offline template shown in the Power Apps Studio canvas.

You can also add a new page based on the Offline template the same way you add pages from any other template.

Screenshot of the Templates gallery, with the Offline template highlighted.

The globe icon in the template's navigation bar uses different icons depending on the value of the Power Fx Connection.Sync function. You can create your own icon and set the Icon property using the following Power Fx script:

Switch(Connection.Sync, 

   ConnectionSync.Connected, Icon.Globe,  

   ConnectionSync.ConnectedWithWarning, Icon.GlobeWarning, 

   ConnectionSync.ConnectedPendingUpsync, Icon.GlobeChangesPending, 

   ConnectionSync.ConnectedError, Icon.GlobeError, 

   ConnectionSync.ConnectedRefresh, Icon.GlobeRefresh, 

   ConnectionSync.NotConnected, Icon.GlobeNotConnected,  

   ConnectionSync.NotConnectedWithWarning, Icon.GlobeWarning, 

   ConnectionSync.NotConnectedPendingUpsync, Icon.GlobeChangesPending, 

   ConnectionSync.NotConnectedSyncError, Icon.GlobeError) 

Limitations and known issues

  • The autogenerated offline profile doesn't handle filters. As a result, for each table used in the app, it downloads all rows to which the user has permissions.

  • Non-Dataverse connectors like Sharepoint aren't supported in offline mode.

  • Some Dataverse tables aren't supported in offline mode.

  • Items in a gallery may appear in a different order in an offline-capable app if no sort order is selected. Choose a sort order in the gallery control to make sure the app behaves consistently in mobile apps and web browsers.

  • Canvas apps that are in offline mode don't support files or images. If your app uses a Dataverse table that has an image in it, users may experience unanticipated errors. If you use a gallery, make sure the template and the layout don't include images.

  • Wrapped apps aren't supported in offline mode.

  • Learn about other mobile offline capabilities and limitations.