cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
MrNappa
Level: Powered On

Components - work around no data source access

I'm writing an app that requires offline capability. As such, in places where data should be saved to the data source, the connection status is checked. If there's no connection, changes are saved to a local buffer, to be saved later.

 

I'm working on the 'saving later' part now. I really want this to be done from any screen, but since there may be multiple buffers I don't want to be copy/pasting a lot of save code all over my app (can you spell 'maintenance horror?' 😉 )

 

That's why I tried using a component, as it's easy to add to any screen and it provides a central place for the save code. The component consists of a label that is visible if any save buffer contains data, and a timer that will take care of checking connection and sending the data when it can. But I'm now running into what I think is listed as a known limitation: "data sources aren't saved with components, so forms and data tables are disabled". The code doesn't recognize the datasource in my Patch( datasource, ... ) code...

 

Is there any smart way to work around this limitation? As I stated, I really, really don't want to be copy/pasting the same code all over, and while I could write a separate 'flush all buffered data' screen that I could let the user navigate to, that would be really interrupting a natural flow throughout the app.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Components - work around no data source access

Hi @MrNappa ,

Do you want to execute the Patch formula within your Component control?

Do you want the data source could be recognized within your Component control?

 

It is an known limit with Component control in PowerApps. The data source you added in your app could not be recognized within the Component control.

 

If you want to execute the Patch formula within your Component control, I afraid that there is no way to achieve your needs in PowerApps currently.

 

If you would like this feature to be added in PowerApps, please consider submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Components - work around no data source access

Hi @MrNappa ,

Do you want to execute the Patch formula within your Component control?

Do you want the data source could be recognized within your Component control?

 

It is an known limit with Component control in PowerApps. The data source you added in your app could not be recognized within the Component control.

 

If you want to execute the Patch formula within your Component control, I afraid that there is no way to achieve your needs in PowerApps currently.

 

If you would like this feature to be added in PowerApps, please consider submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

MrNappa
Level: Powered On

Re: Components - work around no data source access

Yes, ideally I want the Patch command to the datasource to be executed from the component. As I described in the scenario, this would allow me to use the component in every screen to send buffered data once the connection is online. As opposed to duplicate this code everywhere.

 

Admittedly, trying to centralize my buffer saving code in a component is already a bit of a hack, because there is no way of doing so in some kind of background process.

 

I know it is currently a limitation (I included a link to the relevant documentation earlier, but a bot marked that post as spam), that's why I was wondering if someone would have thought some kind of clever way to work around this.

I'll post this to the ideas section too, but I won't get my hopes up 😅.

MrNappa
Level: Powered On

Re: Components - work around no data source access

Seems like nobody has a hack, so I'll just mark your reply as 'answer'. Thanks for thinking with me.


Idea post I made for reference and great justice:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/Allow-access-to-data-source-from-within-componen...

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,201)