Understanding Common Uses of Text Mode


You can expand your reporting capabilities by using text mode in reports and report elements. 
For more information about text mode, see "Understanding Text Mode."

Outside of creating custom prompts which can only be configured using text mode, we recommend that you use the report builder to build your views, filters and groupings. However, there are some instances where you can use text mode to enhance your reports. 

For information about building custom prompts, see "Working with Prompts."

You can also use text mode to build custom calculated custom fields in a custom form. 
For more information about calculated custom fields, see "Using Calculated Custom Data."

Consider the following instances where you would use text mode instead of the standard interface:

Using Text Mode in Calculated Custom Fields

  • Display a Status Time Stamp in a Custom Form: This is a Calculated Field on a Custom Form that enables you to capture the timestamp of when the Status of an item changed to In Progress (INP), for example. You can use this calculation other statuses.
    To add this Calculated Custom Field:
    1. Navigate to a Custom form where you want to add the field.
    2. Add a Calculated Custom Field to the form. 
      For more information about adding a Calculated Custom Field to a Custom Form, see "Creating Custom Forms."
    3. Specify a Label for the Custom Field, for example: Status Timestamp Custom Field
    4. Click Save+Close
    5. Re-open the Custom Form, and select the new Status Timestamp Custom Field.
    6. In the Calculation field, specify the following calculation for your Custom Field:
      IF(Status='INP',IF(ISBLANK({DE:Status Timestamp Custom Field}),$$NOW,{DE:Status Timestamp Custom Field}),{DE:Status Timestamp Custom Field})
      NOTE You must always use the three letter key for the Status in this calculation. 
      For more information about the keys for Statuses, see "Creating and Customizing Statuses in Workfront."
    7. Click Save+Close
      You can then report on the Status Timestamp Custom Field, or use it in other calculations in reports or Custom Fields.  
      NOTE that if your status changes to INP, then another status, then back to INP, only the timestamp of the first change to INP will be captured.

Using Text Mode in Views

  • Display objects in a view that are not included in the standard mode interface. (Some objects can be included in a view only by referencing them via text mode.)
    You can know which fields can be included in a view in either of the following ways:
    • Use the "API Explorer" to discover other objects that can be referenced via text mode.
      Not all the fields documented in the API Explorer are valid fields for text mode. Some fields are only reportable through the API. 
    • A column or field name is not available in the standard mode interface, but the column or field ID is. Most objects that have a column or field ID also have a corresponding column or field name. However, in some cases, only the ID is displayed in the standard mode Interface. You can use text mode to include the column or field name in a view by replacing the fieldnameID with the fieldname:name.
      For example, in the standard mode interface, the Sponsor ID field is available for a project, but the Sponsor Name field is not. You can use text mode to display the Sponsor Name, if you switch the Sponsor ID column to text mode and replace the text in the column with: 
      displayname=Project Sponsor Name
  • Make a calculation between two fields in a column. For example, if you want to find out the number of week days that elapsed between two dates, you can use text mode syntax and data expressions to calculate this difference.
    For example, we want to calculate the week day difference between the Planned Completion Date and the Actual Completion Date of a task.
    To do this, you can add a new column to a task view, and Switch to Text Mode. In the Click to edit text dialog box, paste the following text: 
    displayname=Week Day Difference
    You can use any other two dates in this calculation (Actual Start, Actual Completion, Projected Start, Projected Completion, etc). 
    For more information about calculated data expressions, see "Understanding Calculated Data Expressions."
  • Permanently edit the width of a column.
    You can change the width of a column by using these lines in the text mode of the column:
    For the width line, specify any number (in pixels), depending on how wide you want the column to display in the report. 
    NOTE The usewidths=true line is optional when customizing the view in the following project lists: 
    • Projects I'm On
    • Projects I Own
    • All Projects
  • Merge multiple columns into a single column.
    You can share the data from multiple columns to display it in one column, by adding a third column between them. The added middle column should have the following code in text mode:
    You also have to add the following text to the first column:
    NOTE The valueformat=HTML line is mandatory in a shared column. Otherwise, the columns will contain no information (they will be blank) when the report is exported from Workfront. 
  • Remove the link of an object from a view.
    Some objects that you display in a view are links to the Details page of the object, by default. You can remove this link using text mode. 
    For example, to remove the link to a task in a project report, you may use the following text mode in a column:
    displayname=Task Name 
    NOTE You can use similar code for other objects, and just replace the valuefield line of the code with valueexpression. This will remove the link from the view.
  • Display a collection in a report view. A collection is a list of objects that are linked to one other object.
    For more information about displaying a collection in a report view, see "Referencing a Collection in a Report."
  • Hide a column in a view. You can build a column in a view, for purposes of sorting the view by a certain field, for example, but you can use text mode to hide the information inside the column from displaying in the view. 
    For example, to hide the Task Number column in a task report, replace the text in the Task Number column with the following:
    The important changes in this code which make the column hidden are:
    - displayname must be blank;
    - valuefield has been replaced by value, and must be blank;
    - width=0 
    1.  You can use hidden columns to sort by a certain object that you do not want to display in the view. 
      For example, you can sort by Task Number in a task view in the example provided above, and hide the Task Number information from the view. 
    2. When you hide a column, note that the information in the column is hidden, but the column still exists in the view and it is narrower. 
  • Display an image in a view:
    1. Ensure that you have an image that is stored on a server accessible from Workfront. Ideally, the image is uploaded directly into Workfront. 
    2. Navigate to a project, then click Edit Project
    3. In the URL field, add the link to the image. 
    4. Navigate to a project view in a list or report and customize the view.
    5. Click the header of the column for the Project Name, then click Switch to Text Mode
    6. Add the following code to the column to the existing code: 
      displayname=Link Project Project
      The image you selected replaces the Project Name in the project view. 
    7. Click Save View
      NOTE Images appear in their actual resolution so try to use small images. This example is for projects, but applies to any object with a URL field. You can add it to any column to replace the value of the column with an image. 
  • Display task indentations in a task view or report: Add this code to the Task Name column in a task view, to display the tasks indented according to the Work Breakdown Structure of the project: 
    valueexpression=IF({indent}<1,{name},IF({indent}<2,CONCAT(" - ",{name}),IF({indent}<3,CONCAT(" - - ",{name}),IF({indent}<4,CONCAT(" - - - ",{name}),CONCAT(" - - - - ",{name}))))) 
    This adds up to four dashes before the task name to indicate the position of the child task. 
  • Calculate time and date differences:
    IMPORTANT You cannot calculate the time and date difference in Workfront between two different objects. For example, you cannot calculate the time and date difference between two dates on two different projects, tasks, or issues. 
    You can only calculate the difference between the following:
    • two date fields of the same object.
      For example, to calculate the difference between the Planned Completion Date and the Actual Completion Date of a task add the following column to a task report:
      displayname=Planned-Actual Completion Date
      The result displays in days. The time stamp on the date field is also taken into account, and the number of days might be followed by decimals if the time stamps don't match. 
    • a date field of an object and another date field of its parent object.
      For a list of objects and their parents, see the "Understanding the Interdependency and Hierarchy of Objects" section in "Understanding Objects."
      For example, you can calculate the difference between the Planned Completion Date of a task and the Planned Completion Date of its parent task, or of the project that the task is on. 
      • Add the following column to a task report to calculate the difference between the Planned Completion Date of the task and that of the parent task:
        displayname=Parent Planned Completion - Planned Completion
      • Add the following column to a task report to calculate the difference between the Planned Completion Date of the task and that of the project:
        displayname=Project Planned Completion - Planned Completion

Using Text Mode in Filters

  • Create multiple filter rules that reference the same field.
    In the standard mode interface, when attempting to create multiple filters that reference the same field (using the AND qualifier), one of the filters is deleted when you save the report and exit the report builder.
    For example, Workfront does not allow you to save the following filter rules using the standard mode interface:
    Task Name > Contains > Green
    Task Name > Does Not Contain > Red
    However, you can create these filters using text mode:
  • Filter for items in an approval status: To display only items in a certain status which is currently in Pending Approval: 
    1. Navigate to the filter you want to customize for a list of projects, for example.
      This works the same for any other object with an approval status. 
    2. Add a Filter Rule for the Status field of the object of your list.
      For example, in a project report, add Status Equal Planning, if you want to display only projects which are in a status of Planning - Pending Approval
    3. Click Switch to Text Mode.
    4. Modify the status line by adding a :A to the three letter key of the status:
    5. Click Save Filter.
      You can use the same steps to filter for all statuses of all objects that could be associated with an approval process.  
  • Filter for items by statuses that have the same name and are associated with two different groups. 
    For example, you can have a task status assigned to Group A named New Status with the three-letter key NST. You may have another task status assigned to Group B also named New Status with the three-letter key NES. Although the names for the two statuses can be identical, the three letter code is always unique.
    For more information about group statuses, see "Creating and Customizing Group Statuses."
    To distinguish between the two statuses in our example you can modify the text mode of the filter applied to a task list to ensure items in both statuses are identified:
    1. Navigate to the filter you want to customize for a list of tasks, for example.
      This works the same for projects and issues, as well. 
    2. Add a Filter Rule for the Status field of the object of your list.
      For example, in a task report, add Status Equal New Status, if you want to display only tasks which are in a status of New Status
      Notice that you have only one option for a status named New Status. 
    3. Click Switch to Text Mode.
      The following code should display:
      NOTE Only one status displays here. The status line displays one of the three-letter keys for one of the statuses. 
    4. Add the following two lines of code to add the status that is missing from the filter:
    5. Click Save Filter.
  • Filter items by comparing two fields: for example, display only tasks where the Actual Completion Date of the task is greater than the Planned Completion Date:
    1. Navigate to the filter you want to customize on a task list, for example.
    2. Click Add Filter Rule for the Actual Completion Date field. 
    3. Click Switch to Text Mode.
    4. Replace the text with the following code:
    5. Click Save Filter.

Using Text Mode in Groupings

  • Group list results by a calculated value common to all the objects listed in the grouping.
    For example, you might want to view your tasks grouped by Percent Complete in ranges of 0-25, 26-50, 51-75, 75-99, and 100. Doing so would require using text mode for your grouping.
    The grouping that you want to use for this example is:
  • Add a fourth grouping in a standard report.
    You can have four groupings in a matrix report. For more information about matrix reports, see "Creating a Matrix Report." 
    You can only have three groupings in a standard report through the standard interface. To add a fourth grouping in a standard report, you must use text mode.
    For example, you have a task report which is grouped by Project Name, Progress Status and Planned Completion Date. You want to add a fourth grouping, for Assigned To Name. You can do that, with the following code inside your grouping builder:
  • Rename groupings.
    You can rename groupings to something more familiar to your users. To do that, you can do one of the following in a grouping when you Switch to Text Mode:
    1. Remove all the lines in a grouping that have the word "name" in them, then add the line: Value
      You can also leave the name line blank, in which case the grouping shows the name of the value you are grouping by. 
    2. Add the following line to the existing text mode code in a Grouping:
      group.0.displayname=Your Value

Examples of Views, Filters and Groupings Built in Text Mode

You can use the text mode of complex views, filters and groupings which have been built by Workfront. 

For more examples of already built text mode views, groupings and filters, see "Using Custom View, Filter and Grouping Samples."

This is linked to Understanding Text Mode (article).


This article last updated on 2018-10-17 16:33:16 UTC