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

Timer Control (OnHidden)

Hi All, 

 

I have a timer set to update context (OnTimerEnd) to show the date and time on 2 text boxes.

UpdateContext({time:Text(Now(),"[$-en-US]hh:mm:ss")});UpdateContext({date:Text(Now(),"[$-en-US]dd/mm/yy ")})

 

I would like this to run when the screen is not visible (OnHidden) so I can use the text from the updated labels throughout the app. This will save me creating a timer function for every screen that is visible. 

Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Courtney ,

I agree with @iAm_ManCat's opinion about Timer.

I'm afraid it's not supported to make a Timer keeps running when you are in other screens.

 

So your current problem is about how to update data and fill color of a textinput when you are in other screens?

The answer is yes. You could change a textinput's data and fill color  from other screens.

I've made a similar test for your reference:

in screen1, if I click a button, I will change the text and fill color of a button that is in screen2.

1)in screen1

set the button's OnSelect:

Set(var,true);Reset(TextInput1)

2)in screen2

set the textinput's Default:

If(var,"test")

set the textinput's Fill:

If(var,Red,White)

 

If you click the button in screen1, the button in screen2 will display text "test" and its fill color will change from white to red.

 

 

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.

View solution in original post

3 REPLIES 3
Super User II
Super User II

Heya!

 

Timers can only run while the screen they are on is currently visible, so if I'm understanding correctly then you want the timer to run while you are on another screen? If yes, then that's not currently possible as timers dont 'play' unless you are on the screen that the timer is on, so you'd have to create multiple timers, one for each screen if you want them to update values while on another screen,

 

Its a limitation I've had to deal with before, and currently the only way is to have multiple timers.

I also usually set global variables with the timers so that they are screen-independent, that way the other timers can update the same global variable when they OnTimerEnd,

 

Cheers,

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Thanks! @iAm_ManCat  I thought this approach would help to avoid the issue I am having with where things seem to fall apart "Check your twitter as I caught the problem on camera at last!" 

I was also trying to update a text box off-screen when a user presses a button using the Set function as this is a global variable but I just got it working. Would also like to change the fill colour of the same text box but can't figure that out. 

Hi @Courtney ,

I agree with @iAm_ManCat's opinion about Timer.

I'm afraid it's not supported to make a Timer keeps running when you are in other screens.

 

So your current problem is about how to update data and fill color of a textinput when you are in other screens?

The answer is yes. You could change a textinput's data and fill color  from other screens.

I've made a similar test for your reference:

in screen1, if I click a button, I will change the text and fill color of a button that is in screen2.

1)in screen1

set the button's OnSelect:

Set(var,true);Reset(TextInput1)

2)in screen2

set the textinput's Default:

If(var,"test")

set the textinput's Fill:

If(var,Red,White)

 

If you click the button in screen1, the button in screen2 will display text "test" and its fill color will change from white to red.

 

 

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.

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (43,673)