Follow
Using Conditional Formatting in Text Mode

The standard interface builder provides a great range of flexibility when creating reporting elements to meet the needs in your organization. 

Text mode enables you to create more complex views, filters, groupings, and prompts by allowing you to use fields that are not available in the standard interface. You can also use text mode  to customize views in reports and lists. 

For a complete list of all our reportable fields, see the "API Explorer." 

For more information about using text mode syntax, see "Understanding Text Mode."

Using conditional formatting allows you to change the views of your reports by introducing enhancements to the type and background of the results in the report, as well as icons and flags. We recommend that you always build your views using the most you can use from the standard interface builder. 

NOTE Using CSS styling to customize conditional formatting is not supported. Instead, you must use the pre-designed formatting options that are available in Workfront.

Conditional formatting of views include the following components:

Column Settings

You must be familiar with the text mode interface before you can add conditional formatting to your views. 

You can customize the following elements of a column when using conditional formatting in a report view: 

Column Headers

To change the displayed column header, add the following code to your column: 

displayname= [Name of column]

For example, to name a column Project Owner, the text expression would look like:

displayname=Project Owner

Formatting Dates

Dates can be configured to display in a variety of formats. To establish a date format, you must modify the valueformat line of the text mode code in the column.

valueformat= [new date format]

For example, if you wanted the Projected Completion Date to be expressed as MM/DD/YY the expression would look like: 

     valueformat=atDate 

If you wanted to show the date as Mth, Day, Yr, the expression would look like:

valueformat=mediumAtdate

You can format dates using the following valueformat text mode values:

Format Example  valueformat
MM/DD/YY 10/11/12 atDate
MM/DD/YY Time 10/11/12 12:00pm longAtDate
Mth, Day, YR Oct, 11, 2012 mediumAtDate
DW, Mth, Day, YR Mon, Oct, 11, 2012 partialAtDate
DW, Mth, Day, YR Time Mon, Oct, 11, 2012 12:00 pm fullAtDate

Formatting Numbers

Numeric values can be formatted to display information that best suits reporting needs. To modify the format of a numeric value, you must edit the valueformat line of your column. 

For example, if you wanted to display the Budget column as $1000, the value format line would look like:

valueformat=currencyStringCurrencyRounded

You can format numbers using the following valueformat text mode values:

Example valueformat
1234 doubleAsString
1,234 doubleAsInt
$1,234 currencyStringCurrencyRounded
1234.56 doubleAsDouble
$1,234.56 currencyStringCurrency
12% doubleAsPercentRounded
12.34% doubleAsPercent
(1,234.56) doubleAsFinancial
(1,234) doubleAsFiancialRounded

Column Rules

Column rules allow for the addition of images, color, formatting, and text overrides within a view. Column rules can be established independently or can contain multiple conditions for a column.

Conditional Formatting

A specific text mode statement must be applied when incorporating color or formatting text. 

Insert the following code in any column where you want to add conditional formatting to:

styledef.case.0.comparison.leftmethod= [field name]
styledef.case.0.comparison.lefttext= [field name]
styledef.case.0.comparison.righttext=[field value]
styledef.case.0.comparison.operator= [qualifier]
styledef.case.0.comparison.operatortype= [data type]
styledef.case.0.comparison.icon=false
styledef.case.0.comparison.truetext= 
styledef.case.0.comparison.trueproperty.0.name= [format option] 
styledef.case.0.comparison.trueproperty.0.value= [format style]

NOTE The styledef.case.0.comparison.icon line is always false unless working with icons. The styledef.case.0.comparison.truetext  line is always left blank until working with overwriting text. The styledef.case.0.comparison.righttext line is blank when the qualifier is notblank.

For example, if we wanted to show the Company Name in green text on a project report, you can use the following code:

styledef.case.0.comparison.leftmethod=company:name 
styledef.case.0.comparison.lefttext= company:name 
styledef.case.0.comparison.righttext= 
styledef.case.0.comparison.operator=notblank 
styledef.case.0.comparison.operatortype=string 
styledef.case.0.comparison.icon=false 
styledef.case.0.comparison.truetext= 
styledef.case.0.comparison.trueproperty.0.name=textcolor 
styledef.case.0.comparison.trueproperty.0.value=03a219

NOTE While this statement could be applied to a Company Name column, it could also be applied to any other column on the report. Green text would only be displayed if the project had a Company associated with it. Remember the [field name], [value], and [qualifier] drive whether or not the conditioning ultimately displays on the column.

NOTE When working with qualifiers it is recommended to use cicontains rather than equal. By default, equal looks for ID numbers. Using the cicontains qualifier you can access items by their name. 

Whether Text Color, Alignment, Font Style, or Background Color are applied to a text mode, the same statement (shown above) is used. 

The following lines must be modified to reflect the corresponding formatting needed for the column:

styledef.case.0.comparison.trueproperty.0.name= [format option] styledef.case.0.comparison.trueproperty.0.value= [format style]

Use the following tables to specify the format style of your column:

Text Color Format Option=textcolor
Black

000000

Dark Blue 0c6aca
Teal 1b878c
Green 03a219
Purple 6408c4
Grey 767676
Red d30519
Yellow e19503
Alignment Format Option = align
Left alignment left
Right alignment right
Center Alignment center
Font Format Option = fontstyle
Bold bold
Italic italic
Background Color Format Option = bgcolor
Teal dcf6f7
Green def6e2
Grey e8e8e8
Blue e8f1ff
Purple e9def4
Red eac6c9
Yellow feecc8
White ffffff

Multiple Conditional Formats

You can apply more than one formatting style to a statement. The core statement would remain unchanged and any additional formatting expressions would be added to the statement.

For example, using the earlier statement to include Company Name in green bolded text. The statement would be written using the following code:

styledef.case.0.comparison.leftmethod=company:name 
styledef.case.0.comparison.lefttext= company:name 
styledef.case.0.comparison.righttext= 
styledef.case.0.comparison.operator=notblank 
styledef.case.0.comparison.operatortype=string 
styledef.case.0.comparison.icon=false 
styledef.case.0.comparison.truetext= 
styledef.case.0.comparison.trueproperty.0.name=textcolor 
styledef.case.0.comparison.trueproperty.0.value=03a219 
styledef.case.0.comparison.trueproperty.1.name=fontstyle 
styledef.case.0.comparison.trueproperty.1.value=bold

NOTE When including more than one conditional formatting expression, it is necessary to numerically identify each expression in the statement. Notice that expression 0 and expression 1 have been identified.

Applying Text 

If you want to replace the default values that populate in a column with a value of your choosing, it is possible when applying text to the column.

For example, on a project report, set the Planned Start Date column value to not display the planned start date for the project, but rather the text 'Not Today.' Use the following code for the Planned Start Date column:

case.0.comparison.leftmethod=plannedStartDate 
case.0.comparison.lefttext=plannedStartDate 
case.0.comparison.righttext=2013-04-10T10:45:00:000 
case.0.comparison.operator=ne 
case.0.comparison.operatortype=date 
case.0.comparison.icon=false 
case.0.comparison.truetext=not today
styledef.case.0.comparison.leftmethod=plannedStartDate
styledef.case.0.comparison.lefttext=plannedStartDate 
styledef.case.0.comparison.righttext=2013-04-10T10:45:00:000 
styledef.case.0.comparison.operator=ne 
styledef.case.0.comparison.operatortype=date 
styledef.case.0.comparison.icon=false 
styledef.case.0.comparison.truetext=not today

NOTE: The lines that start with case.0. use case comparisons to identifying the use of text. The lines that start with styledef.case.0. are early conditional formatting statements where we identify the use of text through the truetext expression. Make sure to set truetext to a value, rather than leaving it blank.

Applying Row Formats

If you would like to apply a condition to the entire row, use the following code with your column code:

styledef.case.0.comparison.isrowcase=true

Applying Images  

Similarly to formatting with text, images can be used to display information in reports. Workfront has a number of built-in images to convey visual information in a report setting. To use images in the conditional formatting setting the following statement is needed:

image.case.0.comparison.leftmethod=[field name] 
image.case.0.comparison.lefttext=[field name]
image.case.0.comparison.righttext=[field value]
image.case.0.comparison.operator=[qualifier]
image.case.0.comparison.operatortype=[data type]
image.case.0.comparison.icon=true
image.case.0.comparison.truetext=

For example, on a project report, you want to build a column where you would show a frown face for every Planned Completion Date that does not equal to today's date. Use the following text mode code to add the icon to your column: 

image.case.0.comparison.leftmethod=plannedCompletionDate
image.case.0.comparison.lefttext=plannedCompletionDate
image.case.0.comparison.righttext=2013-04-10T13:00:00:000 
image.case.0.comparison.operator=ne 
image.case.0.comparison.operatortype=date
image.case.0.comparison.icon=true 
image.case.0.comparison.truetext=/interface/images/v4_redux/icons/casebuilder/emoticon_frown.gif

NOTE Notice that the statement uses the icon=true expression. This statement is also different from other conditional formatting statements in that it does not use the style.def format, but rather a unique image format. 

To use the images available, apply the following code:

Icon Value for the image.case.0.comparison.truetext= line
Frown Face  =/interface/images/v4_redux/icons/casebuilder/emoticon_frown.gif
Happy Face  =/interface/images/v4_redux/icons/casebuilder/emoticon_smile.gif 
Blue Flag  =/interface/images/v4_redux/icons/casebuilder/flag_blue.gif 
Green Flag  =/interface/images/v4_redux/icons/casebuilder/flag_green.gif
Red Flag  =/interface/images/v4_redux/icons/casebuilder/flag_red.gif 
Yellow Flag  =/interface/images/v4_redux/icons/casebuilder/flag_yellow.gif 
Black Circle  /interface/images/v4_redux/icons/casebuilder/light_black.gif 
Blue Circle  =/interface/images/v4_redux/icons/casebuilder/light_blue.gif 
Grey Circle  =/interface/images/v4_redux/icons/casebuilder/light_grey.gif 
Green Circle  =/interface/images/v4_redux/icons/casebuilder/light_green.gif 
Orange Circle  =/interface/images/v4_redux/icons/casebuilder/light_orange.gif 
Pink Circle  =/interface/images/v4_redux/icons/casebuilder/light_pink.gif 
Purple Circle  =/interface/images/v4_redux/icons/casebuilder/light_purple.gif 
Red Circle  =/interface/images/v4_redux/icons/casebuilder/light_red.gif 
White Circle  =/interface/images/v4_redux/icons/casebuilder/light_white.gif 
Yellow Circle  =/interface/images/v4_redux/icons/casebuilder/light_yellow.gif