Forum Discussion

AnnDeveloper_'s avatar
AnnDeveloper_
Qrew Trainee
10 months ago

Color row in calendar based on two user fields

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)
------------------------------
  • 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)
    ------------------------------
  • 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
    ------------------------------
  • BrianSeymour's avatar
    BrianSeymour
    Qrew Assistant Captain

    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
    ------------------------------
    • AnnDeveloper_'s avatar
      AnnDeveloper_
      Qrew Trainee

      Brian!! Miss having you around! This looks like it might work Appreciate you guys with the quick responses.

      I'll see if I can make it happen.



      ------------------------------
      Ann Swelgin
      Spring TX
      ------------------------------