0

I currently have a Calculated column that produces a colored circle depending on another column.

=IF( ISERR(RIGHT(LEFT(Level,2),1)-1)
     ,""
     ,"<DIV style='font-weight:bold;
                   font-size:24px;
                   color:"
       &CHOOSE( RIGHT(LEFT(Level,2),1)
                ,"blue ","green","yellow","orange","red")
       &";'>•</DIV>"
   )

I have an issue, when I open up my list item or go to filter my list, it comes up with "•"

This makes it hard for people to know what colors to filter for.

Instead of creating separate views for each color, is there I way I can edit the code in my calculated column to output text aswell as my colored Traffic light?

ie. Next to the red traffic light there's text displaying "Red", next to the blue one there's text displaying "Blue."

0

I solved this using the link here: SharePoint Stoplights to achieve the same thing, you can then use filters to search for 1,2,3 etc. It uses custom XSL link instead of the javascript injection which for our environment at least causes less issues. Also check out This question/answer if you plan to use group by on your view.

| improve this answer | |
0

By adding one more Choose inside the DIV

=IF( ISERR(RIGHT(LEFT(Level,2),1)-1)
     ,""
     ,"<DIV style='font-weight:bold;
                   font-size:24px;
                   color:"
       &CHOOSE( RIGHT(LEFT(Level,2),1)
                ,"blue ","green","yellow","orange","red")
       &";'>• "

         &CHOOSE( RIGHT(LEFT(Level,2),1)
                  ,"Blue","Green","Yellow","Orange","Red")


       &"</DIV>"
   )
| improve this answer | |
  • Thanks so much for this... one more question... Say I wanted to put the text in before the traffic light. Is this possible too? – Michael Apr 11 '16 at 9:07
  • You are building an HTML string... so where would you put it if it was plain HTML? – Danny '365CSI' Engelman Apr 11 '16 at 9:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.