web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / timer and traffic ligh...
Power Apps
Unanswered

timer and traffic lights not working on mobile app

(0) ShareShare
ReportReport
Posted on by 16

i have two apps that use traffic light system to tell if an item is overdue based on the now time. 

 

they are setup in galleries and both use the exact same formula for template fill, which is:

 

If(DateTimeValue(timerbox)>DateTimeValue(ThisItem.'Estimated arrival'),RGBA(128,0,0,.5),If(DateTimeValue(timerbox)>DateAdd(DateTimeValue(ThisItem.'Estimated arrival'),-60,Minutes),RGBA(255,255,0,.5),RGBA(0,128,0,.5)))

where timerbox is from a timer field that has a repeating timer of 1000ms, the onTimerStart formula is:

UpdateContext({timerbox:Text(Now())})

 

This works perfectly accross the two apps to keep the traffic lights updating in real time, however on the mobile app it just shows green, which is the final else statement of the arguement. 

 

Is there some reason this function is performing differently on one platform to another?

 

any ideas would be awesome, but i really cant figure out if i have missed something or this is just a glitch

Categories:
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @cameronajackson 

    You might want to consider doing a more direct date to date comparison rather than introducing text conversions into the process.  Depending on your region, this could cause issues between design and play time environments.

    So, set your Timer formula to the following:

    UpdateContext({timerbox:Now()})

    And then change your TemplateFill property formula to the following:

    If(
    timerbox > DateTimeValue(ThisItem.'Estimated arrival'), RGBA(128,0,0,.5),
    timerbox > DateAdd(DateTimeValue(ThisItem.'Estimated arrival'), -60, Minutes), RGBA(255,255,0,.5),
    RGBA(0,128,0,.5)
    )

    You might still be dealing with date conversion issues with the 'Estimated arrival' date-time, but this should at least cut out a part of the potential problem.

     

    If still an issue, you might consider some troubleshooting steps of putting a label in your gallery with the DateTimeValue(ThisItem.'Estimated arrival') as the Text property to see if there is in fact any conversion issues going on.

     

    I hope this is helpful for you.

  • cameronajackson Profile Picture
    16 on at

    @RandyHayes 

     

    okay so bizarely i tried doing the formulas that way first but powerapps kept spitting errors at me which is why i had all the back and forth text to date time, did it again today and it accepted it. 

     

    it works exactly the same on the desktop platfrom but still no conversion to mobile app.

    The gallery does show the estimated time of arrival and there is another function to add time to it, both display local time accurately and i watched the colours changed as the time conditions kicked in. i also have a clock field working from the same timerbox and the time reflects correctly. 

     

    doesnt seem to be a formula issue so much as the fact that functionality isnt working on the mobile version. 

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @cameronajackson 

    Not sure if you're still having the issue, but I would definitely take a look at any conversion functions that you might still have.  I do find in some cases that the conversions work differently on mobile devices - not because they are broken, but because they convert based on settings on the device itself.  The more you can stick to base-types (date for example) the better you are.  Otherwise you introduce conversion functions and either need to account for differences or will have inaccurate results.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 225

#3
M Bilal Khan Profile Picture

M Bilal Khan 192

Last 30 days Overall leaderboard