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

start timer with OnChange from a textbox

Hi,

 

I am trying to start a timer when the time in my text box changes, I am trying to create a lone worker app, so when someone clicks the check in button on the app the time updates in my SP list, I then have another app with details of the lone worker in the gallery, this is where each time they click check in and update the time on my SP list which in turn will update the time on my new app text box, I am trying to start the timer using on change on the text box but it wont start the timer. I have entered the below.

 

Timer control

Autopause and autostart both false

Start   "TimerGo"

 

Textbox

Default "ThisItem.'CheckIn Time'

OnChange "UpdateContext ({TimerGo: true});"

 

I'm new at Powerapps and I know this is a complex app but I am enjoing learning how to use powerapps.

 

Any help would be much appreciated

 

Ed

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
BobbyNastase
New Member

Hi,

 

I have tried the following and it worked: in the "On Change" property of the textbox try Set (TimerGo,true) and it worked. 

 

Bobby

View solution in original post

WarrenBelz
Super User
Super User

Hi @EdyMac ,

On the OnChange

UpdateContext({TimerGo: false});
UpdateContext({TimerGo: true})

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

View solution in original post

21 REPLIES 21
BobbyNastase
New Member

Hi,

 

I have tried the following and it worked: in the "On Change" property of the textbox try Set (TimerGo,true) and it worked. 

 

Bobby

Hi Bobby,

 

just tried that and its not working for me, does it make a difference that im doing it in the gallery ?

 

Ed

WarrenBelz
Super User
Super User

Hi @EdyMac ,

On the OnChange

UpdateContext({TimerGo: false});
UpdateContext({TimerGo: true})

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Hi @WarrenBelz,

 

I tried your formula and it didnt work so to test it I added a new screen and it does infact work 👍, is the issue maybe because the text box is being updated (Changed) from my SP list ?

 

Ed

Hi @WarrenBelz,

When I manually change the textbox it works but not when its updated automattically from my SP list.

 

Ed

Hi @EdyMac ,

Correct - the OnChange event needs to be triggered by the user changing the value. If you want to change when the screen opens, put it OnVisible of the screen.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Visit my blog Practical Power Apps

Hi @WarrenBelz,

starting the timer when a new item is created in the gallery could work, I've tried putting set(TimerGo, true) on the OnVisible property but the timer doesn't start when a new item is created. how could i acieve this.

 

Ed

 

 

@EdyMac ,

It should work, but try also using a global (Set) variable on the new form trigger

Hi @WarrenBelz 

 

Sorry if I sound dumb but where would I find the new form trigger ?

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,928)