10

I'm using SharePoint 2010 and I'd like to create a column in Task List that will display a message (not generate an email: just display a field text) such as "URGENT" or "Almost Due" when the date is within so many days of the task's due date.

For example, if the Due Date is March 15th, I'd like a text column to display "Almost Due" when the current date is March 12th or later.

7

SharePoint does not support using today's date in a calculated column and the fields are not recalculated unless a value in the item changes.

Here is a solution you could try using SharePoint Designer and conditional formatting:

  1. Create another calculated column to hold [Due Date]-3 (e.g. Warning Date)
  2. Create your [Almost Due] column and put your message as the default value, e.g. URGENT
  3. Open your Task List in SharePoint Designer and click on the View you want to customize.
  4. Click on the Almost Due column in the ListViewWebPart and choose Conditional Formatting > Format Column in the ribbon.
  5. Condition: [Warning Date] > [Current Date]
  6. Set Style: Font color = White, which should hide the message

Rather than displaying/hiding a message, you could use the conditional formatting to change the color of the Due Date to Red or anything else that you think would alert your user.

5

Partly inspired by this question, and partly because we developed a product that has this functionality, I've written a blog post (linked at the bottom) on how to achieve this.

The summary is:

  • JavaScript: Use a Content Editor Web Part.
  • Designer: Create a custom view in SharePoint Designer (as already proposed by @Laurie).
  • Code: Make your own custom field type from scratch.
  • Our product: Buy and install our solution.

Pros, cons, links, and reasons why [Today] is not an option in a calculated column are all discussed in the article: How to use [Today] in a SharePoint list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.