I want to highlight dates when they are past due. (Completion date IS AFTER Due date). Right now my only options for the date is Today or a specific date, but I want to be able to choose another column.
I want to highlight dates when they are past due. (Completion date IS AFTER Due date). Right now my only options for the date is Today or a specific date, but I want to be able to choose another column.
Hello - I am REALLY trying to figure out how to use JSON to update a SharePoint Online list column BASED ON A CHANGE TO A SEPARATE COLUMN.
In other words, If my list has a column called "Completion" and it is a choice column ranging from 0% to 100% (0, 25, 50, 75, 100) and a second column called "Status" with choices of "Not Started," "On Track,""Attention," "At Risk," and "Complete."
How do I use JSON in such a way that, when the Completion column is changed to (for example) "50%," the "Status" column will automatically change to ""Attention?"
Any help would be greatly appreciated.
Mike
We could use the [$FieldName]
syntax to look at the value inside another field in column formatting.
FieldName is assumed to be the internal name of the field.
Simple test for your reference:
Find the internal name of another field via list settings>click on the specified column under Columns option, check the url of the column to get the internal name:
Format the "Completion date" column as shown below:
Code:
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"attributes": {
"class": "=if(@currentField >= [$Duedate], 'ms-fontColor-orange ms-fontWeight-bold', '')"
}
}
More information for your reference:
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
I’m checking how the things are going on about this issue.
Please feel free to reply if there is any update.
5 people are following this question.