Follow
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. 

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: 
      valuefield=project:sponsor:name
      querysort=project:sponsor:name
      valueformat=HTML
      displayname=Project Sponsor Name
      linkedname=project
      namekey=view.relatedcolumn
      namekeyargkey.0=project
      namekeyargkey.1=sponsorID
  • 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
    textmode=true
    valueexpression=WEEKDAYDIFF({plannedCompletionDate},{actualCompletionDate})
    valueformat=HTML
    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:
    width=100 
    usewidths=true
    NOTE: For the width line, pick any number (in pixels), depending on how wide you want the column to display in the report. 
  • 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:
    value=
    valueformat=HTML
    width=1
    sharecol=true
    You also have to add the following text to the first column:
    sharecol=true
    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 
    linkedname=direct 
    namekey=name 
    querysort=name 
    textmode=true 
    valueexpression={name} 
    valueformat=Compound 
    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 it 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:
    displayname=
    linkedname=direct
    querysort=taskNumber
    sortOrder=1
    sortType=asc
    textmode=true
    value=
    valueformat=int
    width=0
    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 
    NOTE In a similar way, you can add a different object in the querysort= line than the object of the column, to force sorting by a different object than the one displayed in the column.
    For example, you can sort by Reference Number in a project report, by adding the following code to the Project Name column: 
    sortOrder=1
    sortType=asc
    querysort=referenceNumber
  • 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

      image.name=Link Project

      image.valuefield=URL

      link.linkproperty.0.name=projectID

      link.linkproperty.0.value=ID

      link.lookup=link.edit

      link.page=/view

      link.valuefield=objCode

      link.valueformat=val

      textmode=true

      type=image

      valueformat=

      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
      linkedname=direct
      querysort=plannedCompletionDate
      textmode=true
      valueexpression=ROUND(DATEDIFF({plannedCompletionDate},{actualCompletionDate}),2)
      valueformat=HTML
      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:
        valueexpression=ROUND(DATEDIFF({plannedCompletionDate},{parent}.{plannedCompletionDate}),2)
        textmode=true
        valueformat=HTML
        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
        textmode=true
        valueexpression=ROUND(DATEDIFF({plannedCompletionDate},{project}.{plannedCompletionDate}),2)
        valueformat=HTML

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:
    name=green
    name_Mod=cicontains
    AND:1:name=red
    AND:1:name_Mod=cinotcontains
  • Filter for items in an approval status: To display only items in a certain status which is currently in Pending Approval: 
    1. Navigate to 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:
      status=PLN:A
      status_Mod=in
    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 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 a 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:

      actualCompletionDate=FIELD:plannedCompletionDate

      actualCompletionDate_Mod=gt

    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:
    textmode=true
    group.0.valueexpression=IF({percentComplete}>=0&&{percentComplete}<=25,'0-25%',IF({percentComplete}>25&&{percentComplete}<=50,'26-50%',IF({percentComplete}>50&&{percentComplete}<=75,'51-75%',IF({percentComplete}>75&&{percentComplete}<=100,'76-100%',''))))
    group.0.linkedname=direct
    group.0.valueformat=doubleAsString
    group.0.namekey=percentComplete
  • Add a fourth grouping in a standard report.
    Four_groupings_in_a_standard_report.png
    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:
    group.0.linkedname=project
    group.0.namekey=view.relatedcolumn
    group.0.namekeyargkey.0=project
    group.0.namekeyargkey.1=name
    group.0.valuefield=project:name
    group.0.valueformat=string
    group.1.enumclass=com.attask.common.constants.ProgressStatusEnum
    group.1.enumtype=TASK
    group.1.linkedname=direct
    group.1.namekey=progressStatus
    group.1.type=enum
    group.1.valuefield=progressStatus
    group.1.valueformat=val
    group.2.groupdatesby=WY
    group.2.linkedname=direct
    group.2.namekey=plannedCompletionDate
    group.2.notime=false
    group.2.valuefield=plannedCompletionDate
    group.2.valueformat=atDateAsWeekString
    group.3.valuefield=assignedTo:name
    group.3.valueformat=HTML
    textmode=true
  • 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: group.0.name=Your Value
      You can also leave the name line blank, in which case the grouping shows the name of the value you are grouping by. 
      Or
    2. Add the following line to the existing tex 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-05-17 21:05:01 UTC