Share via

Highlighting Column on SharePoint Document Library

Anonymous
2024-09-24T15:23:47+00:00

Hello,

I am having trouble highlighting a column on SharePoint. I can get the formula to work on other columns but not the one I am after.

Context:

When someone uploads a document, the 'Created' column updates automatically (standard built in SP column). I have created a column called 'Reviewed', which is essentially the 'modified' default column reworded. I also have a 'Review Date' column which is a calculated column. The review date is based on the 'reviewed'/'last modified' column, but it adds a year to the date.

Created:

Reviewed:


Review Date:

What I am looking for is a formula that turns the text RED on the Review Date when the Review Date has hit. Ideally I wanted one that made all documents uploaded Green, then changes them to Orange when it is 30 days warning to review date and then Red once review date has hit.

I scoured Google for a code:

{ "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", "elmType": "div", "debugMode": true, "txtContent": "@currentField", "style": { "color": "=if([$Created] <= @now, '#ff0000', ''" } }

I tested this in the Created column, and this worked fine and changed the column red.

On the 'Review Date' column it brings up an error when I use the same code, but replace the 'Created' with 'Review Date'.

Please can someone help?

The message is 'Failure: The style values '=if([$Review Date]<= @now, &#39............................ contains one or more of the following disallowed characters (:&;!.

Microsoft 365 and Office | SharePoint | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-09-24T20:20:14+00:00

    Dear Katie Grant - BAS,

    Thank you for reaching out to the Microsoft Community. We’re always here to assist you.

    From your message, it appears that you’re looking for assistance with SharePoint JSON List code. Our forum primarily focuses on addressing issues related to SharePoint’s built-in features.

    Unfortunately, we’re unable to provide the specific JSON code you need. For assistance with JSON code, we kindly suggest you visit the Microsoft Q&A Community. This platform specializes in customized design development in SharePoint. When asking a question, please use the ‘SharePoint Development’ tag. The dedicated team of engineers will focus on your specific scenario and provide you with the complete JSON code to meet your requirements.

    Image Image

    Please accept our sincere apologies for redirecting you to another platform. The moderators in this community have limited experience and resources to support JSON code. To ensure you receive prompt and appropriate assistance, we believe this is the best course of action.

    We appreciate your patience and understanding and thank you for your cooperation.

    Sincerely, Ralph Chawatama | Microsoft Community Moderator

    Was this answer helpful?

    0 comments No comments