Launch Of Improved Expression Assistant

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

Syntax HighlightingSyntax Highlighting

Colored text is way easier to read, and will help you notice if you forget a closing square-bracket or quotation mark.

  • Green - Functions
  • Pink - Data
  • Orange - Numbers
  • Blue - Text

Autocomplete

AutocompleteAutocomplete

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.

Function Guide

Function GuideFunction Guide

The arguments of the current function are displayed above the Expression Input, with the current argument highlighted. 

In-Editor Documentation
In-Editor documentationIn-Editor documentation

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.

Solved Solved
26 41 3,218
1 ACCEPTED SOLUTION

Hi @wabrian 

I would be interested in:

[_THISROW_BEFORE], [_THISROW_AFTER], [_THISUSER], [_THIS]

Slice names

and View names would be extremely helpful, even though I imagine that would involve taking expression context such as CONTEXT() or something close ๐Ÿ™‚

 

Keep up the good work!

View solution in original post

41 REPLIES 41

Love it!

๐Ÿ•บ<< Happy dance!

Sweet

Dark background would be nice!

Hi @wabrian ,

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:

  1. The background color in the suggestion for Table/Column selection is quite faint.
  2. 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.)
  3. The suggestion for functions doesn't work when typing the initial characters of the function.

Thank you,

Please consider updating row number lines and press to tab to choose suggested values like AppSheet toolbox.

Nice, but I hope that it will be able to perform the same tasks as the AppSheet Toolbox developed by the team at AppSheetTraining.com.

Thanks for the hard work.

For the time being, I think AppSheet Toolbox covers my needs better.

I think we need:

  1. Themes (at least dark mode, although this could be said for the whole editor)
  2. Functions, Tables and View name suggestions. I'm surprised it's not already there TBH.
  3. 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.
  4. 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.
  5. 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.

Thanks for all the feedback! @diogolupcosta @T_I_Phong @hien_nguyen @Amine @SkrOYC @Marc_Dillon 
I'll discuss these with our UX designers and see what we can get done! We'll definitely strongly consider all of these ideas.

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.

@wabrian 

 

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.)

dbaum_0-1686273983810.png

 

Thanks for catching this bug. Fix hopefully coming out this week.

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!


@wabrian wrote:

Syntax highlighting stops working in two conditions:
- the expression is invalid
- parsing the expression takes more than 200ms


That's handy to know. I suggest detail that in AppSheet Help documentation (cc: @lizlynch).


@wabrian wrote:

weird


It would be great to understand what qualifies as "weird". I suggest also document those criteria.


@wabrian wrote:

expressions that are not syntax highlighting


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.

@dbaum By "weird", I generally, mean things like 
1,1       ==> this is technically a valid expression, but the latter part of the expression is not used
1) + 1  ==> this is not a valid expression

A new implementation of the Expression system is in the works (hopefully to be released later this year) that will prevent new "weird" expressions from being valid. We plan to be more specific in our documentation as well.

In your case, I suspect that it is large enough and deep enough that parsing takes over 200ms, at which point syntax highlighting will timeout, which allows the UI to remain responsive. I'm happy to take a look if you provide a concrete expression

This tool is nice, i think is better to sort the suggested order column as the schema sort.

So far I have been loving the new improvements but I think tab for indentation is a must have

Most definately

There's something off in the expression editor for the Broadcast Notifications' Deep Link property. Using the expression editor in the Expression Assistant I enter an expression, which then appears in the main app editor window. However, if I re-open the Expression Assistant, the expression editor is empty.

dbaum_0-1687023372805.png

 

dbaum_1-1687023392508.png

 

in mine I have 2 boxes to write expressions

expresiones.png

__________________________________________________________________


After saving and closing the window, I open it again and this is the resultAfter saving and closing the window, I open it again and this is the result

Yep, you have to close the editor after you click on the "improved" button. Then it will show just one

We have been communicating the Toolbox team throughout this whole process. They should hopefully have an update soon that is fully compatible with the new Expression Assistant. 
In the meantime, yes, you need to reopen the modal after toggling if you are using the Toolbox.

I observed the same, and guessed it was related to the AppSheet Toolbox extension. Regardless, when I disabled the extension (until its interaction with the expression editor restablizes), the issue disappeared.

Yes, Craxy.

 

The User INterface is not the best and need some work


@dbaum wrote:

There's something off in the expression editor for the Broadcast Notifications' Deep Link property.


Maybe this is a longstanding issue? I came across a conversation about lack of reliability for this property (although the issue reported there is slightly different):  Broadcast Notification Deep Link Bug - Google Cloud Community . There's no indication in that thread that the issue was ever resolved.

This is likely not due to the new Expression Assistant, but thanks for reporting. I will try to get a fix out shortly!

Agree--see subsequent additional info posted in the separate thread I linked to.

Never mind. I see you already also replied there regarding all the details. Thanks for following up.

Researved syntax of 

  • [_this]
  • [_thisrow_before]
  • [_thisrow_after]

are not available. Hopeful those will be added soon. Ideally, they become available in the list when the context of writing expression is allowing to use those syntax.

@wabrian 

There are still situations that are missing autocomplete. Should we try to list them out, or is work still being done in this regard?

Specifically I want [_THISUSER] to autocomplete. Especially since we saw in the office hours that INPUT() will be getting changed to [_INPUT] (or at least, I think we saw that).

I would be interested to know what autocompletions you would like to see.

Hi @wabrian 

I would be interested in:

[_THISROW_BEFORE], [_THISROW_AFTER], [_THISUSER], [_THIS]

Slice names

and View names would be extremely helpful, even though I imagine that would involve taking expression context such as CONTEXT() or something close ๐Ÿ™‚

 

Keep up the good work!

1st argument of a SELECT doesn't give autocomplete options for any Ref List columns, even though it's perfectly valid, which in turns disables autocomplete for the rest of the SELECT.

SELECT( [Related...][xxx] , [no autocomplete here either] = "yyy" )


@Marc_Dillon wrote:

1st argument of a SELECT doesn't give autocomplete options for any Ref List columns, even though it's perfectly valid, which in turns disables autocomplete for the rest of the SELECT.

SELECT( [Related...][xxx] , [no autocomplete here either] = "yyy" )


Same with ORDERBY() I believe.

 

Condition expressions for branch steps in bots don't seem to have any awareness of their context. As such, they don't start with any column autocomplete capability. Like if I just wanted to compare a column's value on the triggering record, like [column]="x", I type the opening square bracket but don't get any sort of autocomplete dropdown. Autocomplete does appear to work fine for other cases, like if I start with a SELECT, then the autcomplete starts appearing.

Just tested the feature after I found it wouldn't fit my needs when it was first introduced and I still find some things to be absolutely needed in order to use this in favor of the more customizable/superior Qrew's solution

  1. Muscle memory on the tab key is something I don't think I could give up since it's a standard used in many other places (coding). I need tab for:
    1. Selecting one of the suggestions.
    2. Adding indentation (2 blank spaces).
  2. Suggestions for functions. This could be done by suggesting a list of functions after something like a second character being inputed or by using another key combo rather than Ctrl + Space.
  3. [_THISUSER], [_THISROW] in all places, not just 'guessed by context', same with [_THIS] and more explained by Aurelien.

Also it would be great if this is improved:

  1. Delete the closing bracket once the opening one is closed
  2. Custom themes
  3. View names

PLEASE just give us already the gd indentation

Guys will appsheet toolbox extension not work anymore? โ˜น๏ธ I need @SkrOYCs 1st and 2nd points desperately and  as of the time of this comment the extension don't work. I tried reinstalling to no avail !