Forum Discussion
pnthrzrule
Apr 24, 2020Iron Contributor
Conditional Formatting Files Older Than Certain number of days or years
Hello Everyone, I'm aware of the new Conditional Formatting Rule builder that just dropped to my tenant last week. However, I'm wanting to implement formatting that will mark files that have a mo...
- Apr 25, 2020
Hi Michael, (pnthrzrule), yes we do this at our company. The JSON is below and subtracts 2 years (in milliseconds) from today's date. If the Modified date is older than that then the date is red, otherwise it's green:
{ "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "color": "=if([$Modified] <= @now-63113904000, '#c64444', '#468757')" } }
Rob
Los Gallardos
Microsoft Power Automate Community Super User
RobElliott
Apr 25, 2020Silver Contributor
Hi Michael, (pnthrzrule), yes we do this at our company. The JSON is below and subtracts 2 years (in milliseconds) from today's date. If the Modified date is older than that then the date is red, otherwise it's green:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"color": "=if([$Modified] <= @now-63113904000, '#c64444', '#468757')"
}
}
Rob
Los Gallardos
Microsoft Power Automate Community Super User
bderrWI
Nov 12, 2021Copper Contributor
RobElliott - could you show me this, but Bold if it meets the criteria, otherwise regular text.
Thx!