We are excited to formally announce the launch of the improved Expression Assistant, with several features that make it easier and faster to write expressions.
Syntax highlighting
Colored text is way easier to read, and will help you notice if you forget a closing square-bracket or quotation mark.
There is no need for you to remember (or type) the entire column name you wish to reference.
Whenever you type a [, the valid columns in your current context will be shown. You can navigate these with arrow keys or by scrolling. If you accidentally close the completions, you can reopen it by pressing Ctrl + Space.
Autocompletions even work for SELECT-like statements, and additionally can help you complete Table Names for functions that require them.
Documentation is at your finger tips inside the Editor, saving you the time of having to navigate there yourself.
Minor Improvements
Autoclosing of brackets
Highlighting matching brackets
Maintaining indentation when starting a new line
How This Works
Rather than compiling expressions on our server, we now compile as you type in your browser. We compile your expression into a syntax tree, which allows us to understand exactly where in your expression you are. The syntax tree alone allows us to provide colored text, when combined with our documentation we can provide the function guide, and when combined with your data schemas we can provide autocomplete.
Rollout
Several of these features have rolled out to all users over the past couple months. Autocomplete is currently rolled out to free users and will roll out to paid users next week.
We hope this makes it easier to write expressions, and look forward to continuing to improve the Expression writing experience.
It’s fantastic to see the improvements you’ve made. I’ve noticed some changes on my AppSheet browser, and I wanted to bring a few things to your attention that you and your team may want to consider:
The background color in the suggestion for Table/Column selection is quite faint.
I’m unable to use the Tab key to indent a new line or use the Tab key to select a Table/Column in the suggestion section. (Perhaps I’m used to using the Tab key for those actions previously.)
The suggestion for functions doesn’t work when typing the initial characters of the function.
For the time being, I think AppSheet Toolbox covers my needs better.
I think we need:
Themes (at least dark mode, although this could be said for the whole editor)
Functions, Tables and View name suggestions. I’m surprised it’s not already there TBH.
Tab instead of “Enter” to take the suggested option. AppSheet Toolbox took the already standard Tab key that is used on coding environments and I don’t think Enter is a better idea at all.
Tab for indentation. It’s great that if we add indentation manually it is respected when adding a line break, but add indentation manually again and again is not going to be fun in the long term.
Row numbers for line breaks. This helps mainly with troubleshooting
I’d priorityze these in the following order:
2 - 3 - 4 - 1 - 5
I believe most IDEs allow the usage of both Enter and Tab key for selecting an auto-complete suggestion. This is certainly the first time I’ve ever heard of the usage of the Tab key for it, but it seemed to work in the few systems that I tried just now, where Enter also works. I definitely prefer Enter.
Syntax highlighting, including dynamic parentheses matching, is thrown off in the presence of multi-byte characters. Here’s an example with emojis. Although it doesn’t appear in my screenshot, the cursor is just after CONCATENATE; you can see the open parenthesis is erroneously red as if it didn’t have a matching close parenthesis. I imagine this is far more consequential for languages with relevant writing systems, such as Chinese.
(BTW, the same applies to text functions that count characters, such as LEFT in this example, which includes * 2 to compensate. That’s not new, although I think I never reported it before.)
While our key/highlighter is on the expression input field, we wish to use “tab” key for indentation. Currently, it will move from Examples > Data Explorer > Table A > Table B … , which is not actually much useful. To make our formula aligned, we wish to use tab keyboard as it is so on the normal editor.
It is possible that we leave the existing tab key behavior as it is, but we wish to get another behaivor while the highlighter is inside the expression field.
ICYMI: Syntax highlighting disappears altogether if an expression exceeds some length. Maybe this is known or even by design, but I point it out in case it’s a related bug.
Syntax highlighting stops working in two conditions:
the expression is invalid (or weird / or possibly a bug in our compiler)
parsing the expression takes more than 200ms. In my experience, this typically only happens for verry long expressions, or those that are constructed to be very deep syntax trees.
If you would care to share the expressions that are not syntax highlighting that would be great!
That’s handy to know. I suggest detail that in AppSheet Help documentation (cc: @lizlynch ).
It would be great to understand what qualifies as “weird”. I suggest also document those criteria.
One scenario where I commonly encounter this in long image URLs with multiple or long parameters. For example, a QuickChart URL requires a long JSON parameter that includes long arrays of data values and labels. I often populate those values using techniques like nested SUBSTITUTE functions and constructed lists.