Viewing Undefined Variables

You can view a list of all files where you have variables inserted in the content, but those variables have not been defined. This might occur, for example, if you have inserted a variable in a topic and then later change the name of the variable or variable set. The old variable or set name is still used at the location where it was previously inserted in the topic; therefore, a problem exists. From the Undefined Variables window pane, you can open the topic in question and fix the undefined variable. You can also quickly rename or remove multiple variables in a single batch, add the undefined variable to the project, or map the undefined variable to an existing variable.

How to View Undefined Variables

  1. Open a project.
  2. Do one of the following, depending on the part of the user interface you are using:

    • Ribbon Select Analysis > Undefined Items > Undefined Variables.

    • Analysis Summary Window Pane Double-click the row that mentions undefined variables.

    The Undefined Variables window pane opens.

  3. To see more of the information in the window pane, drag the divider bar to make the pane wider.
    • Variable Displays the name of the variable set and the variable within it. The variable set is listed first, followed by a period and then the name of the variable (e.g., Primary.CompanyName).
    • File Displays the name of the file.
    • Title Displays the properties title of the file (if any).
    • Folder Displays the folder where the file is found.
    • Tag Displays the tag being used by the variable.
  4. If a certain number of items have been found, page navigation buttons in the local toolbar may be enabled. You can use these buttons to go to additional pages to display more items. You can also click View All in the local toolbar to see all results on a single page. Keep in mind that the more items you have in the project, the longer it will take to load this view.

How to Fix Undefined Variables

There are a few ways to fix an undefined variable: (1) You can rename the variable or variable set so that it matches what you have used in the topic; (2) you can re-insert the variable in the topic so that it uses an existing variable set/variable name, (3) you can add the undefined variable to the project as a new variable; and (4) you can map the undefined variable to an existing variable.

To Rename Variables

  1. In the window pane, select all variable occurrences that you want to rename. If you want to select all rows click Click to select all rows.. You can hold the SHIFT key to select a range, or you can hold the CTRL key to select individual items.

    Note All variable occurrences that you select will be renamed to the same variable that you provide in the following steps.

  2. In the local toolbar, click the Rename button. The Rename Variable(s) dialog opens.
  3. In the New variable name field, enter a new variable. Type the name of the variable set, followed by a period, then the name of the variable (e.g., MyVariableSet.MyVariableName).
  4. Click OK.
  5. A message lets you know how many files were changed. Click OK. All of the selected variable occurrences are renamed.

    Note If you want to undo the conversions, you can use the Backups window pane (View > Backups). See Restoring Backup Files.

To Re-insert Variables

  1. You can either double-click on the specific row, or right-click on the row and select Open.

  2. Re-insert the variable in the topic, selecting an existing name from a variable set. See Inserting Variables for more information about inserting variables.

To Add a Variable

  1. In the window pane, select all variable occurrences that you want to add to the project. If you want to select all rows click Click to select all rows.. You can hold the SHIFT key to select a range, or you can hold the CTRL key to select individual items.

  2. Do one of the following, depending on the part of the user interface you are using:

    • Local Toolbar Click Click to add a variable to a project..
    • Right-Click Right-click on the variable you want to add and from the context menu select Add Variable.

    The Variable Set Editor opens, with the new variable(s) displayed.

    Note When you create a new variable, one of two things will happen:

    1. If the Variable Set file specified for the undefined variable exists in the project, Flare will add the new variable to the existing Variable Set file.
    2. If the Variable Set file specified for the undefined variable does not exist in the project, Flare will create a brand new Variable Set file in the project and add the variable to that file.
  3. (Optional) In the Variable Set Editor, edit the variable's properties (e.g., name, definition, comment).
  4. Click Save the active file. to save your work.

To Map to a Variable

  1. In the window pane, select all variable occurrences that you want to map to an existing variable. If you want to select all rows click Click to select all rows.. You can hold the SHIFT key to select a range, or you can hold the CTRL key to select individual items.

  2. Do one of the following, depending on the part of the user interface you are using:

    • Local Toolbar Click Click to map to an existing variable..
    • Right-Click Right-click on the variable you want to add and from the context menu select Map to Existing Variable.
  3. In the Variables dialog, select the existing variable in the project to overwrite the current undefined variable reference.
  4. Click OK.

  5. A message lets you know how many files were changed. Click OK. All of the selected variable occurrences are overwritten with the new variable.

    Note If you want to undo the conversions, you can use the Backups window pane (View > Backups). See Restoring Backup Files.

  6. Click Save the active file. to save your work.

What’s Noteworthy?

Note Another way to replace a variable in many places throughout a project is to use the Find and Replace in Files feature in Flare. For example, let's say that you originally inserted a variable named "Company" (from the "Primary" variable set) in a lot of places in your project. Later, you renamed the variable "Branch." You can perform a find and replace throughout your entire project. In the "Find" field, you can enter Primary.Company, and in the "Replace with" field, you can enter Primary.Branch. Also, make sure you select the "Find in source code" option in the Find and Replace in Files window pane. After replacing this text throughout your project, that variable will no longer be considered "undefined". For information about using the Find and Replace in Files feature, see Find and Replace.

Note You can also include this information in reports that you create. See Reports.