Jul 27 2023 03:20 AM
Hello All,
I have a SharePoint list which as several columns. Two of them are date columns.
1-Date revised
2-Next revision date
I have a calculated Next revision date column which shows:
A-) show red if the next revision date is greater than Date revised+1 year
B-) show green for anything else
C-) Show amber if the next revision date is less than today's date-1 month or equal to today's date.
Jul 27 2023 03:57 AM
Jul 27 2023 03:59 AM
Jul 27 2023 04:48 AM
@Naligurtan given that your calculated has the next revision date formula as Date revised +365 I don't quite see how your option A) will ever be met because it will never be more than 365 days ahead of the date revised column.
But I've included it in the following JSON which you add in advanced mode and which will handle the other 2 options.
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
"background-color": "=if(@currentField <= addDays(@now,0), 'gold', if(@currentField > addDays([$Daterevised],365), 'red','green')",
"color": "=if(@currentField <= addDays(@now,0), 'black', 'white')",
"padding-left": "10px"
}
}
Rob
Los Gallardos
Microsoft Power Automate Community Super User
Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)
Jul 27 2023 05:18 AM
SolutionJul 27 2023 01:28 PM
Jul 27 2023 05:18 AM
Solution