Menu

Field Codes

Updated: 2024-01-04

Field codes and constants are the basis of any expressions you create in the Template Editor or the Data Monitor, so understanding how to add and format them is the first step to building conditional content.

Field codes allow you to extract information from a tax return. They are also used to build conditional statements. Use field codes in templates, data monitors and in print set conditions. Field codes used in templates, along with constants and conditions, are enclosed in double braces {{ }} (curly brackets).

Copy a Field Code

Right click on the field and select one of the Copy field code options:

  1. Copy field code puts the code on the Clipboard without brackets. For example: CurrentClient.Engage.Preparer.ClientID. Use this in the Data Monitor, as well as in print set and template conditions.
  2. Copy field code with {{curly brackets}} puts the code on the Clipboard with the curly brackets. For example: {{CurrentClient.Engage.Preparer.OfficeID}}. Use this format in Templates.

Screen Capture: Copy field code

Click on the Blue Bar

  1. In an open tax return, place your cursor in the field on a form that you want to insert into the template.
  2. Click the field code link on the left in the blue bar at the bottom of the TaxCycle window. This copies the field code to the Clipboard, ready to paste into the template.
  3. Hold down the Ctrl key as you click to copy the field code without the CurrentClient. prefix.
  4. Paste the code into the template. For example, {{CurrentClient.Info.ID.FirstName}} will insert the first name of the client (as long as there is a first name in the field).

Screen Capture: Blue Bar Field Code

Copy Workflow IDs

You can use workflow items in templates. To copy the IDs from the workflow screen:

  1. With a file open, go to the Track sidebar and find the workflow item you need.
  2. Right-click on a workflow item and select Copy ID for Template.
    Screen Capture: Copy ID for template

Breaking up field codes

Field codes are divided into parts that narrow down the content within a tax return. Split them up to figure out what form they appear on or to shorten your statement. 

The following is the field code for the First name field on the Info worksheet in TaxCycle T1. This is exactly how it would appear if you copied it from the field.

{{CurrentClient.Info.ID.FirstName}}

CurrentClient This tells the Template Editor to extract the data from the visible or active client. For example, if you are printing a letter from a tax return for the principal taxpayer (not the spouse). But, if you are viewing the tax return of the spouse, it will extract information from the spouse, CurrentClient refers to the principal taxpayer. On the other hand, if you are viewing the letter for the principal taxpayer, but you want to include information for the spouse, you would use CurrentSpouse instead. See Clients and Taxpayers
Info This points to the Info worksheet.
ID This points to the ID section on the Info worksheet.
FirstName This points to the specific name field for the client's first name, within the Info worksheet, under the ID section.

You can use these components to simplify your code. For example, look at the following pieces of code for inserting the taxpayer's address in a letter. By turning the common parts of this group of field codes into a condition (creating an opening statement of {{# CurrentClient.Info }} and a closing statement of {{/ CurrentClient.Info }}. They both do the same thing, but the one on the left is much easier to read and work with.

{{# CurrentClient.Info }}

{{ ID.FirstName }} {{ ID.LastName }}

{{/ CurrentClient.Info }}

{{ CurrentClient.Info.ID.FirstName }} {{ CurrentClient.Info.ID.LastName }}

Why is this important? Not only does it help you read the code more easily, but as you move on to create your own conditions, you will likely look at built-in templates where we have simplified the code quite in this way. If you copy and paste existing code from there into a new template, it helps to know that you might need the {{# CurrentClient }} parent tag or the CurrentClient prefix (or others) to make the code work.

Multi-copy Forms and Slips

The field codes from multi-copy forms or slips contain a number in them to refer to the specific copy. For example:

Slip 1:

{{T4Slips.T4[0].CurrentYear.M[2]}}

Slip 2:

{{T4Slips.T4[1].CurrentYear.M[2]}}

Slip 3:

{{T4Slips.T4[2].CurrentYear.M[2]}}

The [0], [1] and [2] indicate different copies of the same type of slip, in this case the T4 slip.

The numbering of a form or slip always starts at zero. If you see a [-1], it refers to a blank slip. This changes when you start typing in the form or slip.

Expanding Tables

The field codes from expanding tables contain a number in them to refer to the specific row. For example:

Row 1:

{{MedicalExpenses.ExpensesDetails[0].Amount}}

Row 2:

{{MedicalExpenses.ExpensesDetails[1].Amount}}

Row 3:

{{MedicalExpenses.ExpensesDetails[2].Amount}}

The numbering of a row always starts at zero. If you see a [-1], it refers to a blank row. This changes when you start typing in the row.

Check boxes

To display the value of a check box, add the box to the Data Monitor:

  1. Check any one of the boxes in the list but don't move to another field to ensure that one of the boxes in the list remains in focus.
  2. Click the plus sign on the far right of the data monitor to add the field to the Data Monitor.
  3. The field name or line number shows on the left side of the Data Monitor.
  4. The value for the box that is currently checked is on the right side. This is the exact value to use when creating a condition with that check box. Check each box one at a time to see its value.

Screen Capture: Value of a check box

Most check boxes in TaxCycle allow you to select only one from the list, like the principal residence question on T1 Schedule 3. These style of check boxes have a single name in the left side of the data monitor and different values associated with each box.

Other check boxes allow you to select all that apply to a question. Such as the questions in Part A of the T1135. Behind the scenes, these are different. Each box has a different name and value, so you need to add each box to the Data Monitor to see the value, rather than adding just one and switching between them.