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 Create a new variable link.

  4. Name the variable.

    Type a name in the Name box. This is the name you'll use to refer to the variable elsewhere (from within formulas, for example).

  5. In the Value box, type the number, date or text that will comprise your variable.

  6. Click OK.

    The new variable appears in the list on the Variables tab.

  7. Repeat steps 1 through 3 for each variable you want to add.

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

 

Return to top

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