Expression Text Markup with Sublime_Text_3

Almost 2 months I have started with AppSheet and I found that expressions are a language understood by the AppSheet engine but it is not that easy for me to understand it.

It is hard enough to write expressions directly in the Editor’s expression builder while we cannot remember the syntax, or the exact names of the columns from other tables, etc and we can’t place our comments in the expression assistance for others to understand the logic.

I’ve also found that, for me, it is very difficult to understand other people’s expressions when asking in this forum, as they are specific to each and individual person’s apps, specially when they are not formatted in a way to make the structure as readable. I am amazed how leaders in this community are able to understand and respond very fast, I am still are, :astonished: everyday!!

While I am still learning AppSheet, I have a belief that there should be a way for expression to be more easily understood by me and other new users, thus will make our platform bigger and stronger with more and more person-usage.

Those needs brought me to try a text editor named Sublime-Text-3, Sublime Text is text and source code editor for Linux, OS X and Windows with many features.

Again, I am far from full understanding on AppSheet and it is still my early beginning stage by reading this community, help article, blogs and watching YouTube videos, and I am kind of a person that needs to read several times just to get my head understand the meanings, maybe it due the fact that English is not my first language.

With Sublime-Text-3, (while it may be downloaded and evaluated for free, however a license must be purchased for continued use, even though there is currently no enforced time limit for the evaluation), I can do commenting whiles tries to understand expressions and also I can “fold” portions of expressions and start from its most inner “core” to solve its outer core and further cores. I imagine those expressions as layers of onion, thus this is kind of an onion-method implementation to simplify complexity. See below picture, as written with Sublime-Text, where I am trying to understand about WEEKDAY() functions and AND() functions and about Sunday is 1:

Yups, maybe for most of you, the expression in the picture is a very simple expression formula, but to me, I have to break-it down into pieces just to understand it. :joy::sob::sob::sob::sob:

There are some small settings to be performed on Sublime_Text, however further guidance can easily be found and there is also a tag in stackoverflow about this. However, I am not really recommending you to go to stackoverflow, and with just two (2) simple steps should be enough:

  1. Download and install from here.
  2. Setting the view syntax and indentation with below:

Note: There are many code languages available for selection, but I’ve found that using Go as the selected syntax gives more flexibility as it identifies most of the expressions and also with more information to the page, we can get automatically suggested expressions to complete. There are also additional packages for highlighting words that is important, such as below:

That’s all there is for the basic setting.

Yes, it can auto complete ( ), [ ] or { } which most of the time is used during writing expressions. It can also show the onion layers of expression with vertical helper lines and identify the matching bracket as shown in the gif file above, and when entered, it locate the next line bracket or expression sections in its correct place.

  1. To comment a line, we just use //
  2. To comment a section, we can use /* ……… whatever ……*/

Surely after completing our comments to expressions that are being built, a step by step is still required to confirm and test in the editor. However, for some expressions that already are in the final stage, we can just copy and paste to the expressions builder without the comments and we can arrange as such that the final expressions will be available in other section of the page after we have completed our comments to it.

We can also setup folders per Apps being developed, we can have pages for each table related expressions and groups those pages within Sublime_Text, also we can have our own expression library where we collect the most usable and working expressions for reuse on other apps, either by us or by other who needs it.

We can also start collecting our own library as taken from the community responses leaders, and help others who need a typical expression that we have collected. We can collect ALL the solved questions with its expression, marked with title and the forum question_id (QID) as found in the web-address of the community.


The above is sample QID of @Kirk_Masden

Further, with the correct set-up, we should also be able to have a shared expression library like other languages have in GitHub. And we can share it here, in our community later-on.

In addition, by having our expressions being written in a readable format, and copy-pasting those structures from Sublime_text directly to the question forum, we are saving @Steve precious time for not making him reformat our own expressions to help us.

There are some other tools that can be utilized such as Notepad++ (for windows), but I have found that Sublime_Text is in my stack with AppSheet. There may be few limitations for using Sublime_Text, however, it’s still manageable.

I hope you found this information to be useful and I hope it helps.

Ps: I am not affiliated in any way with Sublime_Text and I also don’t provide guarantee that by using this tips you will become a master of expressions, but surely you will get better on it.

5 Likes

Have you checked this extension?

1 Like

Yes, and I have install it also as that is a very good extension.

Thank you for sharing this Tipp @Heru.
Understanding AppSheet Expressions was a challenge also for me. (English is not my mother tongue as well)
I also convert huge expressions in plain text. For me in German Language. To understand them when I need to change something 2 years later :slight_smile:

Found that there might be a Go language Plugin also for Notepad+ +

4 Likes

Thanks @Fabian, you’ve gave me more strength to learn with your input. Btw, the gif sample above is only sample. I am translating comments to my language for others in my group to learn and discuss from there and take benefit of it.

3 Likes