Use virtual columns

A virtual column is a column that doesn't correspond to an actual column in the underlying spreadsheet. Instead, it is automatically computed using an app formula expression.  Virtual column values are not actually stored anywhere, so they won't show up in your spreadsheet once you create them. They do, however, impact your app, behaving much like an ordinary column.

The value of a virtual column is local to the user's device. The result of a virtual column's app formula calculated for one user is not available to other users, and the result may vary for different users.

Here are three common use cases for virtual columns:

  1. To combine other columns: in an app that captures a FirstName and a LastName, a virtual column could construct FullName with the app formula, CONCATENATE([LastName], ", ", [FirstName]). See also: CONCATENATE()
  2. To construct conditional values: in an app that captures contact information, a virtual column called PreferredPhoneNumber may be defined with the app formula, IF([UseMobilePhone?], [MobilePhoneNumber], [PhoneNumber]). See also: IF()
  3. To construct complex Yes/No values: in an app that captures orders, a virtual column named Important? may be defined with the app formula, OR(([Amount] > 1000.0), ([Quantity] > 100)). See also: OR()

The ability to create complex Yes/No values is really important when they are used in other expressions like column constraints and slice conditions. In short, any time there is a need for a complex condition in an app, it is often worthwhile to create a virtual column to represent the complex condition, then use the virtual column wherever needed.

The following sections describe how to use virtual columns:

Add a virtual column

  1. Open the app in the editor.
  2. Go to Data  and select the table to which you want to add a virtual column.
  3. Click + in the table header.
    The new column is added and the configuration dialog is displayed.
  4. Configure the virtual column.
    You must specify an app formula expression. Typically, the app formula uses values of other columns in the same row. The virtual column's type will be automatically detected by the app editor.
  5. Click Done.
  6.  Save the app by selecting one of the following:
    • Save - Save the app
    • Save & verify data - Save the app and verify the data defined.
We've made some improvements to the app editor, currently in preview.
You are opted in to the new editor by default, but you can switch back to the legacy editor at any time.

If you are using the legacy editor

  1. Open the app in the editor.
  2. Go to Data > Columns,
  3. Expand the table to which you want to add a virtual column.
  4. Click Add Virtual Column.
  5. Configure the virtual column.
    You must specify an app formula expression. Typically, the app formula uses values of other columns in the same row. The virtual column's type will be automatically detected by the app editor.
  6. Click Done.
  7.  Save the app by selecting one of the following:
    • Save - Save the app
    • Save & verify data - Save the app and verify the data defined.

Control the order of virtual columns

Virtual columns occur in the table's column order after all non-virtual columns, in the order they were created. In the app editor, the color of the edit icon preceding a virtual column is different than that for a non-virtual column:

Virtual columns displayed at the bottom with a different color edit icon

In detail, form, or table views, you have the option to set the column order. For instance, in a table view the column order is controlled by the Column order option:

Display columns in a different order

Alternatively, you can create a slice with the desired column ordering.

Remove a virtual column

To remove a virtual column, go to the column's configuration screen and click the Delete button

Note that the app editor will not prevent you from deleting a virtual column in use elsewhere in your app. After saving the change, the app editor may display errors noting references to the now-deleted virtual column. These errors will likely render your app unusable until the they are corrected.

Automatic virtual columns

Sometimes, AppSheet will add virtual columns automatically. Typically, these automatic virtual columns are added when a table is first added to the app, or when the table's structure is regenerated. These columns are typically added as a convenience based on common use. You may use, edit, or remove most system-added virtual columns as you see fit.

AppSheet also adds virtual columns to track reverse references. These virtual columns can be recognized by the following properties:

  1. The column name will begin with "Related", like Related Orders.
  2. The app formula will use the REF_ROWS() function.
  3. Column type List and element type Ref.
  4. Description text like "... entries that reference this entry in the ... column".

While the app editor will allow you to delete these columns, they will be recreated automatically the next time the app configuration is saved; there is no way to delete them permanently. Some reconfiguration of these columns is possible, though.

Was this helpful?
How can we improve it?

Need more help?

Try these next steps:

Search
Clear search
Close search
Google apps
Main menu
Search Help Center
true
true
false
false