About Application Variables

There may be times you'd like to attach a piece of information (a value) to your application as a whole. For example, imagine that your application tracks a project. The project has one start date which affects multiple tasks within your project. You'd like to reference this one start date in formulas without needing to enter it for each task. No problem. Just create an application variable to contain the date. Then you can refer to this variable in multiple places throughout your project. The best part is, if the start date changes for some reason, you only need to edit it in one place, and QuickBase updates the value throughout your application. You can create as many application variables as you want.

You can use application variables in two contexts:

When you clone an application, its variables are cloned as well; using variables can help you make configurable application templates.

To create an application variable:

  1. In the menu bar on any application page, select Customize > Application.

  2. Click the Variables tab.

  3. Click the New Variable button. A dialog to enter the variable's name and value appears.

  4. Give the variable a name. This is the name you'll use to refer to the variable elsewhere (within formulas, for example).

  5. Then enter the number, date or text that is the variable's value. Note that the variable's value is always treated as Text within a formula, unless you convert it to another data type using formula functions (such as ToDate()).

  6. Click OK.

    The new variable appears in the list on the Variables tab. To edit a variable's value, simply click its name in the list.

To delete an application variable:

  1. In the menu bar on any application page, select Customize > Application.

  2. Click the Variables tab.

  3. Locate the variable you want to delete and turn on the checkbox to its left. (You can select multiple variables at once. If you selected a single variable, you can delete it using the delete icon (deleteicon.png) in the rightmost column of the table.)

  4. Click Delete to delete the selected variables.

  5. In the confirmation prompt that displays, click Delete.

To refer to a variable from within a formula:

If you want to refer to a variable within a formula, you refer to it same way you reference a value in a field; you enclose the variable name in brackets, like this: [Project Start Date]

However, a simple variable reference may not be enough to get the results you want. Variables are always text. If you want the variable to act like another data type, you need to let QuickBase know. For example, even if you've typed a date in as the variable, you must convert it from text into a date using the ToDate() function. The formula ToDate([Project Start Date]) produces the desired result. You could insert that function within a larger formula to use the application variable to calculate durations or get other results.

For example, you could create an application variable named "Project Start Date", and whose value was "1/1/2002". You then could have a Formula Date field that computed how old, versus the project start date, an issue was when it was closed, by using the following formula:

ToDays([Date Closed]-ToDate([Project Start Date]))

This would be equivalent to:

ToDays([Date Closed]-ToDate("1/1/2002"))

The application variable becomes useful if you have many formulas that depend on this one start date. Correcting the start date is much easier if it's captured in one place as an application variable compared to finding the text embedded in multiple formulas.

Related Topics


This page refers to an older version of QuickBase. Online help is now located at http://www.quickbase.com/user-assistance/default.html.


Return to top   

© 1999-2013 Intuit Inc. All rights reserved. Legal Notices.