Expand my Community achievements bar.

The next phase for Workfront Community ideas is coming soon. Learn all about it in our blog!

How to set display rules in text mode

Avatar

Level 5

I am trying another approach to call out the differences in a grouping on a report. I have added a column for the project priority and added an IF statement to display what I want based on the priority chosen. But I would like to color it Red if Red Alert (priority 4) is chosen. I tried to borrow some code from another column that had display rules but it's not working. Can someone help?

Here is what I have:

styledef.case.0.comparison.icon=false

styledef.case.0.comparison.leftmethod=project:priority

styledef.case.0.comparison.lefttext=project:priority

styledef.case.0.comparison.operator=eq

styledef.case.0.comparison.operatortype=type

styledef.case.0.comparison.righttext=4

styledef.case.0.comparison.trueproperty.0.name=fontstyle

styledef.case.0.comparison.trueproperty.0.value=bold

styledef.case.0.comparison.trueproperty.1.name=textcolor

styledef.case.0.comparison.trueproperty.1.value=ffffff

styledef.case.0.comparison.trueproperty.2.name=bgcolor

styledef.case.0.comparison.trueproperty.2.value=ff0000

styledef.case.0.comparison.truetext=

textmode=true

valueexpression=IF({project}.{priority}=4,"RED ALERT TOP PRIORITY",IF({project}.{priority}=3,"DUE TODAY",""))

valueformat=HTML

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

5 Replies

Avatar

Community Advisor

I'm not sure I'm parsing your question. What result are you trying to achieve and why can't it be achieved by just setting two rules on the column one after the other, as explained here: https://one.workfront.com/s/document-item?bundleId=the-new-workfront-experience&topicId=Content%2FRe...

(why are we in text mode?)

Avatar

Level 5

I am in text mode because I previously altered the wording that displayed using an If statement. Now I want to alter the color if Priority of 4 was selected to make that field Red with white text.

Avatar

Level 8

I don't believe you can throw style rules onto text created from an if statement, but why don't you just use the show text option in the column rules and color it top priorities red? You can do it using the rule builder or your text mode would look like this:

textmode=false

valuefield=priority

valueformat=val

enumclass=com.attask.common.constants.TimelinePriorityEnum

linkedname=direct

namekey=priority

querysort=priority

type=enum

case.0.comparison.leftmethod=priority

case.0.comparison.lefttext=priority

case.0.comparison.righttext=4

case.0.comparison.operator=in

case.0.comparison.icon=false

case.0.comparison.truetext=RED ALERT TOP PRIORITY

case.1.comparison.leftmethod=priority

case.1.comparison.lefttext=priority

case.1.comparison.righttext=3

case.1.comparison.operator=in

case.1.comparison.icon=false

case.1.comparison.truetext=DUE TODAY

styledef.case.0.comparison.leftmethod=priority

styledef.case.0.comparison.lefttext=priority

styledef.case.0.comparison.righttext=4

styledef.case.0.comparison.operator=in

styledef.case.0.comparison.icon=false

styledef.case.0.comparison.truetext=RED ALERT TOP PRIORITY

styledef.case.0.comparison.trueproperty.0.name=fontstyle

styledef.case.0.comparison.trueproperty.0.value=bold

styledef.case.0.comparison.trueproperty.1.name=textcolor

styledef.case.0.comparison.trueproperty.1.value=d30519

styledef.case.1.comparison.leftmethod=priority

styledef.case.1.comparison.lefttext=priority

styledef.case.1.comparison.righttext=3

styledef.case.1.comparison.operator=in

styledef.case.1.comparison.icon=false

styledef.case.1.comparison.truetext=DUE TODAY

I believe this will achieve exactly what you're looking for, just a little simpler to execute.

Avatar

Level 5

I couldn't get this code to work (it displayed the word normal) But I had forgotten about the show text option. I was able to accomplish what I needed using that. Thank You

Avatar

Level 8

The only thing I don't like about this solution is that you can't inline edit your priorities anymore. If you only need this specific adjustment to display in one or two places I would leave it, but if this is a universal thing by group I would change the names of your group priorities in setup.