Discussions

Expand all | Collapse all

Color code off a date field

  • 1.  Color code off a date field

    Posted 21 days ago
    I am trying to use a date field to drive status field color
    For example:
    Date due field is driver
    Then status field would turn to color for:
    Past due (red) ( Pass due date)
    Caution (yellow) 30 days to due date
    Green 31 days or farther from due date
    Blue Item complete (driven off another check box field)


    ------------------------------
    Michael Beverage
    ------------------------------


  • 2.  RE: Color code off a date field

    Posted 21 days ago
    You would need, for reporting, a formula - Rich Text field which you could then have the logic based on the date and what color the back ground should be. We have used similar.

    var number totalDays = [Impact (0-5)]+[Likelihood (1-5)];

    var text red = "<a style=\" text-decoration: none; background: #ea4335; border-radius: 5px; color: #fff; display: inline-block; width: 160px; text-align: center; padding: 8px 20px; font: normal 700 14px/1 \"Calibri\", sans-serif; text-shadow: none; \">"&$totalDays&"</a>";

    var text green = "<a style=\" text-decoration: none; background: #34a853; border-radius: 5px; color: #fff; display: inline-block; width: 160px; text-align: center; padding: 8px 20px; font: normal 700 14px/1 \"Calibri\", sans-serif; text-shadow: none; \">"&$totalDays&"</a>";

    var text yellow = "<a style=\" text-decoration: none; background: #fbbc05; border-radius: 5px; color: #fff; display: inline-block; width: 160px; text-align: center; padding: 8px 20px; font: normal 700 14px/1 \"Calibri\", sans-serif; text-shadow: none; \">"&$totalDays&"</a>";

    var text gray = "<a style=\" text-decoration: none; background: #c2c2c2; border-radius: 5px; color: #fff; display: inline-block; width: 160px; text-align: center; padding: 8px 20px; font: normal 700 14px/1 \"Calibri\", sans-serif; text-shadow: none; \">Missing Rating</a>";

    (If([Likelihood (1-5)]=0,$gray,
    (If(IsNull([Impact (0-5)]),$gray,
    (If([Impact (0-5)]+[Likelihood (1-5)]<=5,$green,
    (If([Impact (0-5)]+[Likelihood (1-5)]=6,$yellow,
    (If([Impact (0-5)]+[Likelihood (1-5)]=7,$yellow,
    (If([Impact (0-5)]+[Likelihood (1-5)]>=8,$red))))))))))))

    ------------------------------
    Ryan Stanford
    ------------------------------



  • 3.  RE: Color code off a date field

    Posted 16 days ago
    Thanks

    ------------------------------
    Michael Beverage
    ------------------------------