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:
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
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:
And then change your TemplateFill property formula to the following:
timerbox > DateTimeValue(ThisItem.'Estimated arrival'), RGBA(128,0,0,.5),
timerbox > DateAdd(DateTimeValue(ThisItem.'Estimated arrival'), -60, Minutes), RGBA(255,255,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.
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.
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.
Check out these cool Power Apps & vote on your favorite!
Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)
Check out whats happening in Power Apps
FIll out a quick form to claim your community user group member badge today!
Features releasing from October 2020 through March 2021