Hello,
I have a gallery with a Sharepoint data source, which is refreshed automatically when new, edit or deleted item.
that gallery is filtered based on selected values in a form.
I'm counting the hours with Begin/End date value from my list. And I'm counting the total of hours of each listed item.
I'm doing it with a button (code below), but I would like to have this count automatically processed each time the gallery is refreshed.
Then I was trying to use some code in the Text param of the Label... but it doesn't work...
I hope someone can help me on this
<Button> OnSelect:
Clear(HoursColl);
ForAll(GalleryList.AllItems,
Collect(
HoursColl,
DateDiff(Subtitle2, Title2, Minutes)/60
)
);
Thanks in advance
Solved! Go to Solution.
I was not able to make the OnTimerEnd function to be triggered properly.
But I use an hidden button to activate my function and use UpdateContext changing the Start variable defined from True to False.
The collection must be generated when you fire events on controls. Like OnSelect, OnChange etc.
So on Form Submit, you may try this collection formula so the Label, automatically displays the value.
Good idea,
indeed the calcul is triggered, but the refresh of the gallery datasource was not completed then it does not provide latest input
For info the gallery is on the same screen and refresh automatically after form is submitted.
I have also another screen to edit entries with another submit, but this is not fired then when navigating back to the screen with the gallery the label is not updated.
Hi @LGE ,
Maybe you could try to use Timer Control to refresh the datasource automatically.
Refresh(datasource)
https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/functions/function-refresh#syntax
Best Regards,
Charlie Choi
@v-yujincui-msft good idea, but the problem is not on the refresh of the datasource but on the calculation after the gallery has been updated following a refresh...
Ideally I need to call the calculation AfterRefresh. How to trigger this kind of action?
Hi @LGE ,
Maybe you could try to put the formula for the calculation and the formula for refreshing the data source in the same Formula bar.
Best Regards,
Charlie Choi
I was not able to make the OnTimerEnd function to be triggered properly.
But I use an hidden button to activate my function and use UpdateContext changing the Start variable defined from True to False.
Hi @LGE ,
When the timer ends, the formula in the OnTimerEnd property will be executed.
Here is a link that might help you:
https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/controls/control-timer#key-properties
Best Regards,
Charlie Choi
User | Count |
---|---|
247 | |
105 | |
82 | |
50 | |
43 |