cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

timer and traffic lights not working on mobile app

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

3 REPLIES 3
Highlighted
Super User
Super User

Re: timer and traffic lights not working on mobile app

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Highlighted
Frequent Visitor

Re: timer and traffic lights not working on mobile app

@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. 

Highlighted
Super User
Super User

Re: timer and traffic lights not working on mobile app

@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.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,863)