I need a bit assistance with the JSON coding for what I need/want to do.
I have a document library, I have a column named Exp Date. What I would like to have happen is the text for the date turns orange if the current date is within 6 months of the Exp Date and red if the current date is within 30 days of the Exp Date and green if it's not within the two conditions.
Below is the code I am using, what little I know of JSON, I thought this was correct, but it's not working. It will do the fist condition and set it to orange, but it's not setting the condition for red, but at the end it does set all others to green.
I am sure it's a simple syntax error, but I am just not seeing it at the moment.
{
"$schema": " ;,
"elmType": "div",
"txtContent": "@currentField",
"style": {
"color": "=if(@currentField <= @now + 15552000000, 'orange',if(@currentField <= @now + 2592000000, 'red','green'))"
}
}
I have a document library, I have a column named Exp Date. What I would like to have happen is the text for the date turns orange if the current date is within 6 months of the Exp Date and red if the current date is within 30 days of the Exp Date and green if it's not within the two conditions.
Below is the code I am using, what little I know of JSON, I thought this was correct, but it's not working. It will do the fist condition and set it to orange, but it's not setting the condition for red, but at the end it does set all others to green.
I am sure it's a simple syntax error, but I am just not seeing it at the moment.
{
"$schema": " ;,
"elmType": "div",
"txtContent": "@currentField",
"style": {
"color": "=if(@currentField <= @now + 15552000000, 'orange',if(@currentField <= @now + 2592000000, 'red','green'))"
}
}