Forum Discussion

Joseph_Butler's avatar
Joseph_Butler
Copper Contributor
Mar 12, 2021
Solved

Color Code SharePoint List cell based on Due Date and Status columns

I am using the Javascript (at the bottom) on my SP 2013 site to color code a Due Date field.   This code as written, does just that.   However, if the Status column for the list item is set to Co...
  • Don Kirkham's avatar
    Mar 15, 2021

    Joseph_Butler 

    Not sure if this is exactly what you need. You should be able to modify where this code is located.

     

    Before the first line of code in your, add the following.

     

    if (!ctx.CurrentItem.DueDate || ctx.CurrentItem.Status.toLowerCase() === "completed") return;

     

    This checks if the DueDate exists and then if the Status = Complete. If either condition is true, the function exits (return;)

     

    If this works for you, please mark this response as the answer. Thanks!

Resources