cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sanderson82
Helper IV
Helper IV

Refresh Now() in a label with timer

I have a one screen app with a gallery displaying on a tv screen and a timer set to refresh the data every hour.  I've been asked to show date/time of the last refresh.

 

I've added a label with the text : "Last Refresh: " & Now()

 

Can someone advise how I can refresh the text in the label using the existing timer that refreshes my datasource?

 

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User III
Dual Super User III

Try the following instead.

Set OnStart for the app instead of Screen onVisible to 

set(RTime, Now())

Set the Label to 

Concatenate("last refreshed: ",Text(RTime,"[$-en-GB]mm/dd/yyyy hh:mm" ))

 Set the timerEnd  to

set(RTime, Now())

Make sure timer is set to AutoStart



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Pstork1
Dual Super User III
Dual Super User III

Instead of using Now() in the label set the label to use the value of a variable.  Then in the timerEnd property of the timer set the value of that variable to a formatted time string using Now().  That will automatically update the label.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Thanks @Pstork1  I have attempted this but still no joy.

 

Screen1 OnVisible: Set(RTime,Text( Now(), "[$-en-GB]mm/dd/yyyy hh:mm" ))

 

Label: "Last Refresh: " & Text(RTime)

 

OnTimerEnd: Set(RTime,Text( Now(), "[$-en-GB]mm/dd/yyyy hh:mm" ))

Pstork1
Dual Super User III
Dual Super User III

Try the following instead.

Set OnStart for the app instead of Screen onVisible to 

set(RTime, Now())

Set the Label to 

Concatenate("last refreshed: ",Text(RTime,"[$-en-GB]mm/dd/yyyy hh:mm" ))

 Set the timerEnd  to

set(RTime, Now())

Make sure timer is set to AutoStart



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

@Pstork1  thank you!  Working perfectly now

 

Helpful resources

Announcements
User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,469)