Skip to main content
Question

Color row in calendar based on two user fields

  • February 29, 2024
  • 0 replies
  • 94 views

I have two fields Assigned to Primary and Assigned To Backup. I want to show a color for both (each different) on one record (calendar item). 

Is it possible?



------------------------------
Ann Developer)
------------------------------
This topic has been closed for replies.

  • Author
  • Registered
  • February 29, 2024

I also thought about just making a rich text formula to make the user in each field text and doing a background color on it that way when it showed on the calendar it would show their names in a different color for each of them and no row colorization.



------------------------------
Ann Developer)
------------------------------

MarkShnierYou
Forum|alt.badge.img+24

Yes, you can use Rich Text and even including hyperlinks as a calendar field to show.



------------------------------
Mark Shnier (Your Quickbase Coach)
mark.shnier@gmail.com
------------------------------

Forum|alt.badge.img+12
  • Registered
  • March 1, 2024

What's up Ann? It's been a minute.

In a Quickbase Calendar system I've build, we leverage a plain ol' text field to give end users the ability to specify their Calendar color. Then, we use formula fields to convert that color into a "swatch" for table reports and reuse that same color in Calendar reports. In your case, I'd suggest considering building a Color Code Formula Text field, then updating the Color-Coding section in your Calendar Report to "Use a formula" that points to [Color Code] field. That way you can reuse the color logic across multiple reports without duplication and makes future maintenance easier, as you can any necessary color revisions in one place to update everything!

Here are some snippets and a screenshot for ideas. Also, check out Mozilla's docs for color reference.

// Calendars::Color Available (Text)
// This field expects a hex value or CSS "named color" option. Check Mozilla's docs for reference.
// https://developer.mozilla.org/en-US/docs/Web/CSS/named-color#css_level_3_values

// Calendar Events::Color Code (Formula - Text)
// For use on Calendar Reports
If (
    // [Has Validation Error] = true, "tomato",

    [Is Booked]    = true,
    [Calendar - Color Booked],

    [Is Tentative] = true,
    [Calendar - Color Tentative],

    [Is Available] = true,
    [Calendar - Color Available],

    // Default
    [Calendar - Color Unavailable]
)

// Calendars::Color Available Swatch (Formula - Rich Text)
// For use on Forms and Table Reports
var Text base = "height: 12px; width: 12px; border-radius: 50%; border: 1px solid; border-color: #f7f7f7;";
var Text fill = "background-color: " & [Color Available];

"<div style=\"" & $base & $fill & "\"></div>"


------------------------------
Brian Seymour
------------------------------