Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Color Coding SharePoint List Item Columns Based on Today's Date

$
0
0

I have a SharePoint Online list where I have been able to format the background color of the cells in the column based on the text in the field using this formula:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "div",
  "txtContent": "@currentField",
  "style": {
    "padding-left": "14px"
  },
  "attributes": {
    "class": "=if(@currentField == 'Apr-2020', 'ms-bgColor-blueLight', '') + ' ms-fontColor-black'"
  }
}

It looks like this:

What I would like to have happen is for the Jan-2020 entries to be automatically made darker because January 2020 is now in the past (based on today's date).  How can I modify the formula so that when months are in the past that the color for that column automatically makes the color darker?  It would also be nice to have the formula changed so that instead of it looking for a specific value, that if there is any value the colors are applied.

Thanks for your help!


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>