Page tree
Skip to end of metadata
Go to start of metadata

Variables

In general, variables are values stored in predefined formats that is accessible throughout a knowledgebase. The various types include:

To use a variable in a formula expression, wizard field, search or report, you need to prefix it with a $, for instance, $conversion_rate. Whether you are using a global variable, system constant, or user variable, you should refer to it by the variable name, not the label.

Global Variables 

Global Variables are values stored in predefined formats that can be customized by the user and will be applied throughout the knowledgebase wherever the variable appears. They can determine a wide variety of settings in the KB, including:

  • The title wording displayed in the open tab of the browser.
  • The URLs for logging in and logging out of the KB.
  • The maximum size of email attachments.
  • The displayed product name.
  • The default language.
  • The maximum column length per row in tables.
  • Whether attached PDF files containing text fields with an OCR option should have the OCR included in the attachment.
  • How long a record will stay locked when a user opens it for editing.

Most global variables can be created or edited by navigating to Setup > System > Manage Global Variables but some global variables in the Power-User Interface can also be also set in the Admin Console so as to be available to all the KBs on a particular server. Additionally, some variables can be set only in the admin console, and cannot be changed in the Power-User Interface. Due to their potential to cause performance issues on a shared server, these Admin Console-specific global variables are only available for customers installed on dedicated or on-premise servers. 

Global Variable Wizard


The Global Variable wizard consists of two tabs:

  • Customized Variables – Contains the list of variable that have been enabled for customization in the KB. Variables in this tab can be created, edited or deleted.
  • Variables with Default Values – Contains the entire list of variables, including those which have been customized and those which have only default values.

Variables which are left with their default values are indicated with an Add button, and variables which have been customized are indicated with a checkmark icon.

Edit the variable in the Customized Variables tab after pressing Add. Clicking the Edit icon will open the dialog for the variable, where you can set a new value and add notes. 

Deleting a variable customization requires that the Deletable value be set to Yes. Additionally, a deleted variable is not actually removed – it will still be available in the Variables with Default Values tab where it can be customized again if needed.

For a list of all global variables, refer to the Global Variables List page.

System Constants 

Unlike Global Variables that can be edited or deleted, System Constants are used in read-only mode. They are defined for the entire knowledgebase. For example, the $global.daylightServer constant returns true or false depending on whether the server is configured to account for daylight saving time.

System constants have the prefix $global. A full list of system constants is available in the Global Variables tab of the Formula Wizard.

Field Variables 

Field variables are used throughout the system to insert values from a record in email templates, print templates, variable formula fields, and anywhere fields can be referenced in a formula. For example, you can use the First Name variable in an email template so the greeting can include the recipient's name.

The field variable corresponds to the field name and is set automatically when you create a custom field. The Field Name is automatically populated based on the Field Label. Field names can't include most special characters.

Field variables are prefixed with "$" in most settings; for example, the variable for the Company Name field in the Contracts table is $company_name.

To see a list of field variables in any Agiloft table, navigate to the Fields tab of the Table wizard and find the Field name column.

Field name variables

To insert variables, refer to the appropriate syntax depending on the feature.

Field Variable Chains

It is possible to create a chain of field variables to use fields in other tables when creating email and print templates. The syntax is:

$fieldname1.fieldname2

where the first field is a linked field in the current table which points to another record; the second field name is the field in the linked table whose value you want to use.

User Variables 

User Variables find information from the current user's record in the People table. Saved Searches and Reports can use variables based on information obtained from the user table. If a saved search reads Company=$global.my_company and there is a field named Company in the User table, the value of this field for the current user would be substituted into the search when it is run. For a user who works for Acme, the resulting search condition would thus be Company=Acme.

When you are running a report, these values are substituted at run time for each user so that a single report sent to multiple users contains the appropriate information for each of them–Sonya gets a report of all bugs she submitted, while Jaime gets a report of all bugs that he submitted.