Home
Forums
New posts
Search forums
What's new
New posts
Latest activity
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
All Topics
Technology
Conditioning Column Formatting based on Date and entry in another Column
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Vee711" data-source="post: 740121"><p>I am completely new to this and am trying to create a Register in Sharepoint.</p><p></p><p>Basically what I want to do is:</p><p></p><ul> <li data-xf-list-type="ul">If the date in Column 1 is coming up in the next 5 days, I want to change the font to orange</li> <li data-xf-list-type="ul">If the date in Column 1 is overdue, I want to change the font to red</li> <li data-xf-list-type="ul">If the date in Column 2 is not empty, do not format Column 1 (basically, remove the formatting in Column 1 once Column 2 is filled).</li> </ul><p></p><p>Context: Column 2 is the date the action in Column 1 is completed.</p><p></p><p>I tried using Co-Pilot to help me with JSON and it came up with the following but it doesn't seem to work:</p><p></p><p>[CODE] {</p><p> "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",</p><p> "elmType": "div",</p><p> "txtContent": "@currentField",</p><p> "style": {</p><p> "color": "=if([$COLUMN2] != '', '', if(@currentField <= @now, 'red', if(@currentField <= @now + 2592000000 && @currentField > @now, 'orange', 'green')))"</p><p> }</p><p>}</p><p>[/CODE]</p><p></p><p>Can I please get some guidance?</p><p></p><p>Thanks!</p></blockquote><p></p>
[QUOTE="Vee711, post: 740121"] I am completely new to this and am trying to create a Register in Sharepoint. Basically what I want to do is: [LIST] [*]If the date in Column 1 is coming up in the next 5 days, I want to change the font to orange [*]If the date in Column 1 is overdue, I want to change the font to red [*]If the date in Column 2 is not empty, do not format Column 1 (basically, remove the formatting in Column 1 once Column 2 is filled). [/LIST] Context: Column 2 is the date the action in Column 1 is completed. I tried using Co-Pilot to help me with JSON and it came up with the following but it doesn't seem to work: [CODE] { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "elmType": "div", "txtContent": "@currentField", "style": { "color": "=if([$COLUMN2] != '', '', if(@currentField <= @now, 'red', if(@currentField <= @now + 2592000000 && @currentField > @now, 'orange', 'green')))" } } [/CODE] Can I please get some guidance? Thanks! [/QUOTE]
Name
Verification
Post reply
Home
Forums
All Topics
Technology
Conditioning Column Formatting based on Date and entry in another Column
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top