Help with colorizing calendar

  • 0
  • 1
  • Question
  • Updated 3 years ago
  • Answered
I copied this formula from another help thread.... only the first line works... I can't figure out why the other two lines do not work... I would like to add more names/colors. Here is exactly what I have right now... Can anyone figure out what I am missing? Thank you.

If(IsNull([Employee Name]),"",

[Employee Name]="Amanda Torrisi","<div style=\"background-color: #ff9999;\">Amanda Torrisi</div>",

[Employee Name]="Ryan Emery","<div style=\"background-color: #FFFF00;\">Ryan Emery</div>",

[Employee Name]="KathySweeny","<div style=\"background-color: #ffff99;\">Kathy Sweeny</div>")
Photo of Amanda

Amanda

  • 10 Points

Posted 4 years ago

  • 0
  • 1
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
Check out this post here.  Bottom line is that you color the text but not the background.


https://quickbase-community.intuit.com/questions/1155875-how-do-i-add-color-coding-to-a-calendar-rep...

I believe you need to show the entry as a link to the record for his to work.  There was a long thread in that post and that turned out to be the problem.
Photo of Amanda

Amanda

  • 10 Points
I read that post but it is not helping me. Can I just change the background-color part to text color? I tried but I don't know if I am writing the formula correctly. I am also trying that formula from the above linked thread... what exactly do I write after the "VarText"...is that the name of the field I created for the color formula?
Photo of Amanda

Amanda

  • 10 Points
It is weird that the first line of the formula works on the calendar report but the rest do not. I have an attachment that I am going to add
Photo of Amanda

Amanda

  • 10 Points
As you can see, the formula partly works... I just don't know why the other lines don't work. 
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
What I found in my extensive testing is that if you only have one field, you can color it.  Note that you can configure the calendar to show more than 1 field, but I was unable to get font colors working with more than 1 field.    So the complexity in that other post was simply me making a combined field which put the various fields together in one field separated by a | character.

In your case, you seem to just want to show 1 field, which is the name.  So you should be able to just set the font colour.


Not tested but try

If(

[Employee Name]="Amanda Torrisi","<font color=#ff9999>Amanda Torrisi",

[Employee Name]="Ryan Emery","<font color=red>Ryan Emery",

[Employee Name]="KathySweeny","<font color=blue>Kathy Sweeny")
Photo of Amanda

Amanda

  • 10 Points
Yes, I am only trying to colorize one field.I tried this and it is the same as before, it works for Amanda but not the others.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
Can you post your current formula and a screen shot of the result?
Photo of Amanda

Amanda

  • 10 Points
Current formula: If(

[Employee Name]="Amanda Torrisi","<font color=#ff9999>Amanda Torrisi",

[Employee Name]="Ryan Emery","<font color=red>Ryan Emery",

[Employee Name]="KathySweeny","<font color=blue>Kathy Sweeny")

Screen shot below in "Answer" section show result from original formula but the current formula gives exact same result just with colored text vs. background.
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
Right, so in my original answer I said that it will only work if you just show 1 field on the calendar.  You are listing a name and then other fields on the calendar.  So not just 1 field.

I suggest that you get rid of the other fields on the calendar to prove to yourself that it will color properly if there is just 1 field.

The set about making a combined fields with all the fields you want on your calendar separated buy a | character.  then switch the calendar to use the combined field.

QuickBase is aware that the calendar needs to be more friendly in this area of colorization, but for now we need to work around the issues until they upgrade it.
Photo of Amanda

Amanda

  • 10 Points
Yes, even with just the one field it still only displays the first name. I am starting to think it is something to do with the user settings or something? I tried to switch the names on the lines and it is actual users that will not show up... What can this mean?
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
Maybe contact me off line via the information in my profile and I will have a quick look.
Photo of Amanda

Amanda

  • 10 Points
So...all employee names work except for the two who were in the original formula....So on my report everyone shows up all colorized...except the two employees whose colors wont work show up blank!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
Are you saying that its basically working but not for certain color codes?
Photo of Amanda

Amanda

  • 10 Points
No the colors are fine... Here is my formula that totally works for everyone except "Kathy Sweeny" ... She just shows up blank on the calendar.
If(
[Employee Name]="Amanda Torrisi","<font color=red>Amanda Torrisi",
[Employee Name]="Brandon Phipps","<font color=blue>Brandon Phipps",
[Employee Name]="Eric Benz","<font color=green>Eric Benz",
[Employee Name]="Mike Carroll","<font color=orange>Mike Carroll",
[Employee Name]="Kathy Sweeny","<font color=blue>Kathy Sweeny")
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
OK, so what is happening is that you do not have an employee called "Kathy Sweeny".  So maybe it's  a spelling error or some issue with trailing blanks.

meanwhile do this

If(
[Employee Name]="Amanda Torrisi","<font color=red>Amanda Torrisi",
[Employee Name]="Brandon Phipps","<font color=blue>Brandon Phipps",
[Employee Name]="Eric Benz","<font color=green>Eric Benz",
[Employee Name]="Mike Carroll","<font color=orange>Mike Carroll",
[Employee Name]="Kathy Sweeny","<font color=blue>Kathy Sweeny", [Employee Name])

That way you will have Kathy come out as her uncolored name and you can see what she is really called in your app.
Photo of Amanda

Amanda

  • 10 Points
Ok well she is displaying.. in black..which is fine and her name is still displaying as what it should... so I am just going to leave it at this because it works for now. Thank you so much for your patience and help!
Photo of QuickBaseCoach App Dev./Training

QuickBaseCoach App Dev./Training, Champion

  • 67,278 Points 50k badge 2x thumb
OK, well check the source of her name.  Its probably from a drop down list and it has a trailing space after it.
Photo of Paul

Paul

  • 52 Points
well, i do stuff like that.

my solution may not work for everything you're after - everyone's use case is different. but.



i set my calendar up to use the date start, no end date, and 'don't show duration of events'

and use a SINGLE field to display on the calendar.



i use a forumla-text field and do some css to smush and color.



"<div style=\"font-family:Arial; border: thin solid #dddddd; background-color:#dddddd; font-size:13px;\">" &

"<b> " &   [Contact] & " </b>"   &

"<div style=\"line-height:3px; font-size:11.5px; color:#636363; background-color:#188d16;border-top: thin  solid #188d16; border-bottom: thin solid #188d16; border-right: thin solid #188d16; font-family:Arial;display:inline; color:#FFFFFF; \" ><br><i>" &

 "&nbsp;" &[Event Start] & "&nbsp;" & "</i></div><br><span style=\"font-size:12px; letter-spacing: 1.5px; color:#002ea9;\"><b>" &   Upper([Location] ) & "</b></span></div>"

&"</div>"

&"<div style=\"margin-top:3px; border-bottom: thin solid #00b9f2; \">"&"</div>"



i'm attaching a snapshot of what i get - the colors jpg

for the record, i usually DON'T color the background at all, and focus more on doing text that fits nicely and is more legible for my users. the white jpg

 and i use the thin line between events as a nice delineator.  you can still do all of the if statements, just make the different cases be their own formatting.

i'm sure you could even clean it up some by declaring the colors as variables and doing the logic before the heavy lifting part of the code.

keep me posted.