Build and test simple and complex expressions using Expression Assistant as described in the following sections.
- Access Expression Assistant
- Build an expression using Expression Assistant
- View and insert column references into expressions
- View and insert predefined patterns into expressions
- Test expressions
- Keyboard shortcuts
See also:
Access Expression Assistant
Within the app editor, you can access Expression Assistant anywhere you're able to enter an expression.
To access Expression Assistant:
-
Click the flask icon next to an input field to toggle to the expression format (if available). For example:
-
Click in the expression field indicated with an equals sign (=). For example:
Note: The equals sign indicates that the expression's result will be used as the setting's value.
Expression Assistant opens. Build and test your expressions as described in the following sections.
Build expressions
Build expression using Expression Assistant as shown in the following figure.
As highlighted in the previous figure, Expression Assistant enables you to:
- Build your expression in the text area
-
- Confirm the valid syntax and function of the expression
- View and insert column references or predefined patterns into the expression using the tabs at the bottom of the dialog
- Test the expression
- Expand the text area by:
- Dragging the handle in the lower-right corner to accommodate more complex expressions that span several lines
- Collapsing the tabs at the bottom of the dialog
- Save the expression by clicking Save or use
Ctrl-Shift-S
on PC or⌘-Shift-S
on Mac
With the Expression Assistant improvements turned on, you can take advantage of the following features to assist you with AppSheet function syntax:
- Syntax highlighting to display components of an expression in different colors
Color key:- Green: AppSheet functions
- Pink: Data references, such as column names
- Blue: Text
- Orange: Numbers
- Syntax of current function with contextual highlighting
- Auto-completion for columns (when cursor is positioned within an expression or column definition)
Note: You can use theCtrl + Space
keyboard shortcut to display the auto-completion suggestions.
- Documentation panel for quick access to the description and syntax for the current function
View and insert column references into expressions
View and insert column references into expressions by clicking the Data Explorer tab, as shown in the following figure.
Data Explorer tab enables you to:
- View all tables and columns in your app
- Insert a column reference into an expression, as described below
- View
Ref
associations (references to other tables) - Expand and collapse table, and pin their display in Expression Assistant
To insert a column reference into an expression:
- Click within the expression text area where you want to insert the column reference.
- Expand the table that contains the column you want to add.
- Position your cursor over the column name and click Insert.
View and insert predefined patterns into expressions
View and insert predefined patterns into expressions by clicking the Examples tab, as shown in the following figure.
The Examples tab enables you to:
- Select an expression type
- Insert a predefined pattern into an expression, as described below
To insert a predefined pattern into an expression:
- Click within the expression text area where you want to insert the example pattern.
- Select the tab based on the expression type that you want to add.
- Position your cursor over the example pattern and click Insert.
Test expressions
To test the results of the expression for each row in the table, click Test in Expression Assistant. The Expression Test page displays.
The first column shows the Expression Result for each row in the table, as shown below:
Expand the Expression Result by clicking the expand icon to view the results of each part of the expression:
Keyboard shortcuts
The following keyboard shortcuts are available in Expression Assistant.
Shortcut description | PC | Mac |
Save expression | Ctrl-Shift-S |
⌘-Shift-S |
Decrease indent for current or selected lines | Ctrl-[ |
⌘-[ |
Increase indent for current or selected lines | Ctrl-] |
⌘-] |
Move selection one word to the left | Ctrl-LeftArrow |
Alt-LeftArrow |
Move selection one word to the right | Ctrl-RightArrow |
Alt-RightArrow |
Delete word before the current cursor location | Ctrl-Backspace |
Alt-Backspace |
Delete word after the current cursor location | Ctrl-Delete |
Alt-Delete |
Move selection one element to the left | Alt-LeftArrow |
Ctrl-LeftArrow |
Move selection one element ot the right | Alt-RightArrow |
Ctrl-RightArrow |