cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate V
Advocate V

Disconnect - Connect database to Powerapps 'automatically'

Hello all,

I have a question which I am unsure if it is possible or not. I have an app that uses an Excel source file, which from time to time will get updated (and is on OneDrive). Due to it being updated, the connection and/or data might not be shown correctly; thus needing to disconnect database/datasource and reconnect it again.

My question is: is it possible to make that 'automatically'? By flow or some other?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Disconnect - Connect database to Powerapps 'automatically'

Hi @FelipeCaru ,

When the data source is updated, do not recreate the connection.

I recommend you use the function of Refresh to refresh the data source.

If you want to automatically refresh the data source, you could combine with the Timer control and the function of Refresh.

Here's an example for your reference:

Set the Timer's AutoStart: true

                        Duration: 6000  (6s)

                        Repeat: true

                        OnTimerEnd: Refresh(fruit)

 

After these settings, the data source will automatically refresh every 6 seconds.

 

Best regards,

Community Support Team _ Phoebe Liu

 

Community Support Team _ Phoebe Liu
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
Highlighted
Super User
Super User

Re: Disconnect - Connect database to Powerapps 'automatically'

I am not aware of any way at present to automate renewing a broken connection to a data source.  

Highlighted
Community Support
Community Support

Re: Disconnect - Connect database to Powerapps 'automatically'

Hi @FelipeCaru ,

When the data source is updated, do not recreate the connection.

I recommend you use the function of Refresh to refresh the data source.

If you want to automatically refresh the data source, you could combine with the Timer control and the function of Refresh.

Here's an example for your reference:

Set the Timer's AutoStart: true

                        Duration: 6000  (6s)

                        Repeat: true

                        OnTimerEnd: Refresh(fruit)

 

After these settings, the data source will automatically refresh every 6 seconds.

 

Best regards,

Community Support Team _ Phoebe Liu

 

Community Support Team _ Phoebe Liu
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

Highlighted
Advocate V
Advocate V

Re: Disconnect - Connect database to Powerapps 'automatically'

@v-yutliu-msft 

Thanks for the answer. Question: in that example code, what would "OnTimerEnd: Refresh(fruit)" mean? (with the 'fruit' part). Asides from that, how do I use this code? And, due to the probable size of the source (might get to be 5000 rows at most), refreshing every 6s might be tad too much. Is there a way to make it so when opening the app, it does what you said, and then every hour or so?

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020 Winner Announced

Check it out!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,168)