Power Apps Canvas renewed the offline functionality so that there is offline profile, which saves data with selected filter into your mobile device when there is no connection to Internet. With offline profile, the user has only the offline profile data in mobile phone. What if the user wants to bypass the offline profile filters on demand but still be able to go to the offline state when needed?

Imagine that there are data from 10 years and offline profile gets only past 3 months data. What if user wants to see data from 9 years ago. With mobile app the offline profile gives user only the offline profile data from past 3 months. There are two options to go around this. First option is create cloned Canvas Apps and other is in offline and the other is online version. If you want to reduce the maintenance amount, please use shared components in both of the apps. The second choice is to use Power Automate to get the online dataset, since calls to Power Automate will work only when mobile has connection to Internet. Blog about second option will follow later.

This blog demonstrates the first option, how to create two Canvas Apps with offline and online mode and call each other with toggle button.

Create Dataverse table(s) and offline profile

  1. Create the data model and tables for your solution.
  2. Create example data with Excel and import to your table.
  3. Set in the table advanced properties the offline mode capability.
  4. Then create a offline profile and set filters so that they won’t get all the data from the tables, i.e. get only past month data.

More detailed instructions in Timo Pertilä blog post below.

Create Offline and Online Canvas Apps

1. Create Canvas App, start with setting the offline setting to get the top bar and controls for online/offline mode. Selected the created offline profile for your app.

2. Develop the Canvas App to read data from Dataverse table(s) into i.e. Gallery component.

3. Add a Toggle control (or some else component) for switching between offline and online mode. Leave it as it is for time being.

3. Publish the app. Test it in the mobile, fix if needed and republish.

More instructions can be found in Timo Pertilä blog post below about offline profile and Canvas App creation.

4. Create a copy of the app for online version of the app.

5. Go to solution view, open the copied app and go to settings. Rename the app and unselect the Can be used offline setting in step 1 for this online app.

6. Rename the app label in top of the app if needed.

This demo app does not include using shared components among these two apps. Below is blog post about creating and using components from library among multiple apps.

Link Offline and Online Apps

1. Go to solution view and then select Details under three dots.

2. Copy the web link for both online and offline app.

3. Open the offline app, select the Toggle control and choose OnChange event and paste.

If(Toggle1_1.Value = true, Launch("ONLINE_APP_WEB_LINK", {}, LaunchTarget.Replace))

4. Save and Publish (top right corner) the offline app.

5. Open the online app, select the Toggle control and choose OnChange event and paste.

If(Toggle1_1.Value = false, Launch("OFFLINE_APP_WEB_LINK", {}, LaunchTarget.Replace))

6. Set Default value to true

7. Save and Publish (top right corner) the online app.

You are all set, now you have working solution switching between the apps. You can also try the second option with Power Automate.

Online app shows all the data in Dataverse tables without any limitations
Offline app shows filtered data from Dataverse tables by offline profile filter

 

 

 

 

 

 

 

 

If your Edge browser is opening new window, please set below setting off in all Edge profiles .