Skip to main content
Question

Color coding formula based on another formula field

  • November 21, 2023
  • 0 replies
  • 168 views

I have a formula rich text field called Last Opened Date with the following formula to trim a logged field so it only pulls out the date:

Trim(Right([*Vista Last Opened Date (Log)],10))

In my report, I want to color code a field called Report Name if the date in the Last Opened Date field is more than 120 days before today.  Can you please tell me what formula to use for this?  I've tried several and nothing has worked.

Thank You,

Rachel Miller



------------------------------
Rachel Miller
------------------------------
This topic has been closed for replies.

Forum|alt.badge.img+9
  • Quickbase Alumni
  • November 21, 2023

You'll need to make sure your report name is formula rich-text, and then something like this will work: 

var bool overdue = (Today() - [Last Opened Date]) > Days(120);

var text name = [Field that actually has the report name]; //This is the text that will show in your element

"<p style='text-align:center; width: 100px; " & if( $overdue, "background: red; color:white;"'>" & $name & "</p>"

The <p> tag just make it a block element so you can set a standard width to make the column look the same width up and down, adjust as needed. In the above I just have it setting the background to red and font-color to white, you can plug in your own hex color or alternate color though as needed. 



------------------------------
Chayce Duncan
------------------------------