cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Refresh data source only after 2nd click

Hi,

 

I have a very strange senarion happening.

I have a gallery acting as tabs and on my last tab I have a condition that refreshes my data souce to recalculate totals.

 

I have added in a notification to test if this is the case... and notification works.

But I have to click the relavant tab again before the data is refreshed.


The reason why its a view is beacuse Powerapp constantly failed to display calculations ... different problem for antoher day

OnSelect

 

If(
    Parent.Selected.Value.ID = "Summary",
    Refresh('[dbo].[BiReviewSummaryCalcAgg]');  // <- MSSQL View
Notify("Y u no refresh ??", NotificationType.Information) ); Select(Parent);

 

DB is still empty and has very little data.


If i use a timer it only works the first time it reached the end. After that the notifications keeps on popping up but the data never refreshes.

App setting:
All Preview Features are on except for Enable enhanced Microsoft SQL Server connector - off

4 REPLIES 4
Highlighted
Frequent Visitor

Re: Refresh data source only after 2nd click

I feel like this is a problem I have encountered, it's not that the datasource isn't refreshing I think it's more to do with the selected.ID not being updated (still storing the old values hence why they don't change) try reselecting the ID from the gallery after the refresh.

Highlighted
Community Support
Community Support

Re: Refresh data source only after 2nd click

Hi @PaulVZ ,

I suggest you make the timer control repeatly automatically.

Please set the Timer's:

Repeat to true

AutoStart to true

AutoPause to true

OnTimerStart to the condition that you want

Here's a doc about this control for your reference:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-timer

If using Timer still can not solve your problem, please tell me.

 

 

Best regards,

 

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.
Highlighted
Frequent Visitor

Re: Refresh data source only after 2nd click

Hi iiBZy,

 

Thank you, for your idea. I have also tried adding this data in a collection to force a update of values but still had to click twice for data to reflect.


@iiBzY wrote:

I feel like this is a problem I have encountered, it's not that the datasource isn't refreshing I think it's more to do with the selected.ID not being updated (still storing the old values hence why they don't change) try reselecting the ID from the gallery after the refresh.


 

Highlighted
Frequent Visitor

Re: Refresh data source only after 2nd click

Hi v-yutliu-msft,

 

Thank you, I have created the timer component as you suggested and seems to have done the trick.

 

If I have to ignore the fact that there will be a data call every couple seconds and ignore that there will be a constant call to the DB I would be happy to accept that this is my life now.

 

it works ... is it pritty ...  heck no ... I feel I need a shower now 😉

Helpful resources

Announcements
Ignite

Microsoft Ignite

This will be a conference that you do not want to miss!

secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,038)