How to get data from Dataverse into Canvas App outside the offline profile filters? Previous post demonstrated how to create two different Canvas Apps and change between them. The second possibility is to use Power Automate to get the data from Dataverse and bind to the same gallery control displaying the offine profile data. If there is no Internet connection, there will be notification for user to wait until mobile gets online.

If the data amount is huge and rules getting the data are complex, it might be better to follow the choice number one and clone app with shared components. If the data is quite simple, this approach could be better solution to get the data outside offline profile filters. When Power Apps Canvas App is set to be used in offline mode and offline profile is created with filters, mobile device shows only filtered data even if it is online and connected to Internet.

Create Power Automate

1. Create Power Automate and button for calling the flow

2. Implement the Power Automate flow to get data from Dataverse and return data in Respond action to Canvas App

3. Set below code to the button OnSelect event
Use the same collection name that originally is used in the Gallery control. Create table properties identical for Dataverse table names, then Gallery component works both requesting directly from Canvas Apps and trough Power Automate. As you see, there’ needs to be’s mapping that needs to be done. Complex data from multiple tables could be done with previous post duplicate apps if this gets too complicated in your case.

If(
    IsError(
        ClearCollect(
            exampleData, 
            ForAll(
                Table(ParseJSON(Getonlinedata.Run().data)),
                {
                    Data: Text(Value.dg_data),
                    Date: DateValue(Value.dg_date),
                    Title: Text(Value.dg_title)
                }
            )
        )
    ),
    // On failure
    Notify(
        "You are offline, cannot connect to database",
        NotificationType.Error
    ) 
    
)

Using the error handling you can catch the error message when in offline and type yours instead.

Now you are all set with getting data bypass the offline profile when the phone is online and in this solution there is no need to change the mobile app.