
I have a gallery.
In the gallery I have a label with this:
If(IsToday(ThisItem.'Last Assigned'),Text(ThisItem.'Last Assigned',DateTimeFormat.LongTime),"")This produces the following:
I added a timer, and it runs every second.
It populates a variable.
Set(var_HourCheck,Now())I then use this variable in a label to get the current time:
Text(var_HourCheck,DateTimeFormat.LongTime)Which gives me this (very top above red arrow)
My goal is to be able to fill the label with either red or green.
I want to compare the two times.
If the time under Accept time is within an HOUR, highlight the label red.
If it is greater than an hour, highlight it green.
I really dont know how to do this and am looking for assistance.
The most I can find is to use DateDiff, but not sure how to use that in an IF statement.
Hi @lardo5150
You code should like this:
If(
DateDiff(ThisItem.'Last Assigned', var_HourCheck, Minutes) <= 60,
RGBA(255, 0, 0, 1), // Red if within an hour
RGBA(0, 255, 0, 1) // Green if greater than an hour
)
If you have any questions or feedback, please let me know. Have a great day! 😊
-----------------------
PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]
I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻