Hi all,
I have a date column in a sharepoint list. I want to check people's birthday and then do something with that. Eg, change the display color of the birth day to red.
But off course I only need the day and month. How do I write an expression to compare the day and month to todays date?
Solved! Go to Solution.
Ok so I placed a gallery in a test app just to show you how it works in a gallery, may need to edit slightly to match your needs but here goes.
My gallery has a items value of
CoachingDatabase
which is just a random splist i have with dates in it so chose that
Title box in that gallery has text value of
Text(DateValue(ThisItem.DATE),"dd/mm")
and a color value of
If(
And(Day(ThisItem.DATE)=Day(Today()), Month(ThisItem.DATE)=Month(Today())), Red, Green)
which results in the following, where every date that matches today shows in red, and otherwise date is green
Can you clarify, are you wanting to change its color in sharepoint, or in powerapps. and if in powerapps how are you currently displaying your data in powerapps, control type etc
Hi @TheRobRush . Thanks for your assistance.
It is a text box that displays the date like this :
Text(DateValue(gallery.Selected.SPColumnName),"dd/mm")
I want to show this text in a different color (in PowerApps!) when the day and month matches today's day & month.
The SP Column is date column without time.
Ok so I placed a gallery in a test app just to show you how it works in a gallery, may need to edit slightly to match your needs but here goes.
My gallery has a items value of
CoachingDatabase
which is just a random splist i have with dates in it so chose that
Title box in that gallery has text value of
Text(DateValue(ThisItem.DATE),"dd/mm")
and a color value of
If(
And(Day(ThisItem.DATE)=Day(Today()), Month(ThisItem.DATE)=Month(Today())), Red, Green)
which results in the following, where every date that matches today shows in red, and otherwise date is green
Wow @TheRobRush !! Thanks, that worked like a charm and I'm super happy with it. Glad to end my week like this!! Kudos!
User | Count |
---|---|
121 | |
88 | |
88 | |
75 | |
66 |
User | Count |
---|---|
216 | |
180 | |
138 | |
96 | |
80 |