cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sanderson82
Level: Powered On

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

Re: Refresh Now() in a label with timer

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

Re: Refresh Now() in a label with timer

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.
sanderson82
Level: Powered On

Re: Refresh Now() in a label with timer

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

Dual Super User
Dual Super User

Re: Refresh Now() in a label with timer

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

sanderson82
Level: Powered On

Re: Refresh Now() in a label with timer

@Pstork1  thank you!  Working perfectly now

 

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,037)