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

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
Dual Super User

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" ))

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.

@Pstork1  thank you!  Working perfectly now

 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,040)