Cleaning "no-code"

Good day. As you know, this no code application thing is an industrial revolution at the cyber level, however I am sure that there must be practices that help to better synchronize the applications. Practices of "good work".

I believe that Appsheet should develop a "protocol" procedure or I don't know if Appsheet but also the users themselves. If a developer shares the App with another developer, the differences in the way of working become evident, which, on the other hand, will always exist but, with a protocol, such gaps would be reduced.

Is there a way to clean up the "no-code" to improve synchronization? I mean, expression writing, database morphology. I know that what I am asking will be the reason for others to tell me to go study before, but I am telling you that I developed an App without knowing anything and that is the revolutionary thing about Appsheet. Do, then learn.

3 13 586
13 REPLIES 13


@Gustavo_Eduardo wrote:

Is there a way to clean up the "no-code" to improve synchronization?


Based on your post, I am not sure if you mean "synchronization" between systems or between developers.

Can you describe some of the issues you have faced and would like to avoid?

Hi @WillowMobileSys  no no, what I mean is that there are ways and ways to build applications without code, but the difference between one way or another is the cleanliness and directionality of the expressions.

Inexperienced people like me not only don't have good writing expressions (we write as we speak, like cavemen) but also that, when passing the app to another developer, he prefers to redo it than fix it.

For this reason I thought of a Standard.

@Marc_Dillon  created one of his own and, if he tries to develop it for everyone, he will be the one who carries the flag in this as I see it as very beneficial since all of us, in an effort to improve our production, will be able to opt for safe steps that ensure a better how our apps work...

"Handling the same language"

FWIW, the analogous Microsoft platform indeed has documented PowerApps Canvas App Coding Standards and Guidelines | Microsoft Power Apps

Muchas gracias por tu respuesta @dbaum  voy a mirar lo que dejaste.

An "Appsheet Standards" document would be a very beneficial thing. I've certainly developed my own set of standards, some of which are half-way written down in various spots. I'm sure other experienced builders have as well. A few years ago I think @GreenFlux and I had started to write down some standards in an organized way. I don't believe we got very far before abandoning that due to being busy, but I could probably dig up the old draft somewhere. I'd be happy to help contribute if people want to take up this task again.

Hey @Marc_Dillon ! Yeah, I started a style guide a few years ago but never finished it. Here's what I have if anyone else wants to take it over. 

# Intro
## SQL-Friendly Style Guide for AppSheet
AppSheet’s naming restrictions for columns and tables are much more relaxed than SQL databases, and will allow using [reserved words](https://en.wikipedia.org/wiki/SQL_reserved_words), spaces, and even special characters. This speeds up development by eliminating the need for separate *Column Names* and *Display Names*, in most cases.

However, migrating an app from Google Sheets to an SQL database becomes much more difficult when tables and columns have to be renamed, templates updated, etc. That can be very time consuming in larger apps, which tend to be the ones that need SQL databases. Furthermore, these larger apps are more likely to have multiple developers.
## Purpose
**The purpose of this Style Guide is to:**
- avoid table & column names that would cause SQL migration issues, and
- define a consistent standard for naming *all* elements, which will
- ease future maintenance in multi-developer environments.

*Smaller, single developer apps that will never need an SQL database would probably benefit from using more relaxed naming conventions, instead, to avoid needing separate Display-Names.*

# General
## Best Practices for naming all elements
==**Consistency** is the key!==

UpperCamelCase, lowerCamelCase, snake_case, etc., are style choices that are SQL-compatible. Just pick a standard and stick to it.

#### Do
- use short (preferably 1-2 word) but descriptive names
- ensure the name is unique and does not exist as a [reserved keyword](https://www.sqlstyle.guide/#reserved-keyword-reference "Reserved keyword reference")
- keep the length to a maximum of 30 characters
- begin names with a letter
- only use letters, numbers and underscores in names
- use underscores where you would naturally include a space in the name
- 'first name' becomes `[first_name]`
- avoid abbreviations and if you have to use them make sure they are commonly understood
- use plural form for List/EnumList
- `[related_invoices]`, or `[selected_options]`


##### Don't
- use SQL Reserved Words *(alone)*
- use `[approved_date]` *vs* ~~`[date]`~~
- use plurals except for lists/EnumLists:
- instead, use the more natural, collective-term where possible
- i.e. `[staff]` *vs* ~~`[employees]`~~, or `[people]` *vs* ~~`[individuals]`~~
- - When a collective term does not exist, use singular table names
- `[User]` *vs* ~~`[Users]`~~
- use a table name as a column name (except Ref’s), & vice versa `invoice[`~~invoice_~~`num]`
- end names with an underscore_


# Data
Special care should be taken when selecting table and column names for apps that may one day be migrated to an SQL database. Other sections of this guide are purely for style/ consistency, but the **Data** section is critical for future SQL compatibility.
### Tables
#### Do
- Name join-tables using terms that describe the relationship
- `[registration]` *vs* ~~`[student_class]`~~

##### Don't
- name join-tables by combining table-names
### Columns
#### Do
- ** Use Uniform suffixes:** __time _date, _at, _on, _by *(created/edited)* _
- Name all Ref-type columns with the same name as the table- not the key.
- `[client].[name]` *vs* ~~`[client_id].[name]`~~
- Consistently name all keys in all tables:
- `[id]`, `[key]`, or `{table}_id`

##### Don't
- attempt to use sequential keys (unless table is read-only for all users)
- use App Formulas for sheet columns when Initial Value + Reset on Edit would be safer.
- include table names in column names `invoice[`~~invoice_~~`number]`

### Slices
#### Do
- include the table name AND reason for the slice
- - `active_client` vs ~~`active`~~

##### Don't
- asdf
- asdf

 

# UX
## General
**All top-level parent tables should have matching icons/format rules applied to:**
- the label _(whatever that happens to be, name, Invoice#, etc),_ and-
- primary views for that table,
- actions associated with that table, where appropriate (LINKTO\*)

For App-Users, this provides a visual link between rows, views, buttons, etc.- to clearly indicate they are all part of the same table. And for developers, the consistent visual cues will aid in navigating the editor.

## Views
#### Do
- **Follow AppSheet's system view naming convention:**
- `{table/slice_name}_{view_type}`
- `Customer_Form`, `Product_Detail`, etc
- Avoid spaces & special characters
- Select an appropriate icon for all views (instead of default)
- add display names to all system 'Detail' views, to indicate 'Table/Slice Name'
##### Don't
- asdf
- - asdf

___
📌 - **Tip:** By using the format `{table/slice_name}_{view_type}`, the table/slice name can be determined with `INDEX(SPLIT(CONEXT(View),"_"),1)`
## Format Rules
#### Do
- Include table/slice-name and reason for rule (color, status, etc)
- **Rule Name:** *Active Client Red*
- Add an icon to the label for all 'parent tables'
- 👤 `customer[name]`, 🧾`invoice[number]`
- Use that same icon for the views. Be consistent!
-
##### Don't
- 'stack' rules with matching conditions and rely on ordering for the intended result. Be more specific with the rule conditions so that only one is true.
-


# Behavior
## General
#### Do
- All names should consist of at least two words in the format *Verb-Noun*:
- `SAVE FILE`, `OPEN URL`, `DELETE USER`
- Always select appropriate icon, even for hidden Actions, Views, etc
- Use Different names for the Workflow/Report/Process, and their individual Actions/Tasks.
*(Analogous to using a table-name for a column-name)*
##### Don't
- asdf
- asdf
-
## Actions & Tasks
#### Do
- Indicate the Action/Task type *(by name, or at least implied)*
- Send Email, View Site *(Go to website-implied)*, Set Status* (Change Data-implied)*
- always select an appropriate action icon, even for hidden actions
-

##### Don't
- asdf
- asdf
## Workflows, Reports & Processes
#### Do
**For Workflows, Reports & Processes that contain a single Action/Task:**
- Include the Action/Task name, but don't copy it exactly
- i.e. **WF:** 'Send Email: Welcome Letter', **Action:** 'Send Email'

**For multiple Actions/Tasks**
- use a name that describes the entire set of Tasks/Actions
- i.e. **WF:** 'New User Onboarding', **Actions**: 'Add User', 'Send Email'

##### Don't
- use a workflow where an action, grouped action, form submit action, etc- would work, and not require a network connection to sync
- asdf
-
# Expressions
## General
Expression formatting does not affect SQL compatibility. The guidelines in this section are intended to aid in readability, future maintenance and consistency.
#### Do
- Use ALL CAPS for all AppSheet function names
- `USERSETTINGS()`, `SELECT()`, `[_THISROW]`, etc
- Use UpperCamelCase for function with a fixed list of AppSheet defined parameters *(Quotes optional, because these never have spaces):*
- `CONTEXT(ViewType)`, `CONTEXT("AppName")`,
- Use double quotes on all other strings, even when not required
- ` LINKTOVIEW("User_Form")`
- Add Line Returns and Tabs for readability

```
SELECT(staff[name],
AND(
[department]="Operations",
[status] ="Active",
[shift] ="Days"
)
)

```

##### Don't
- use a single line for expressions with multiple functions or conditions
- re-use the same SELECT()/FILTER() expression in multiple places
*(make a Slice, instead)*
- add 'expensive' *Virtual Columns* just to display a total, average, etc.- unless realtime data is needed *(consider a Report, instead)*
- nest multiple versions of the same sub-expression just to change one input.

>**Tip:** create a separate *Virtual Column* or *Slice* for the sub-expression, then reference it in the main expression for easier readability.

Markdown to HTML:

Show More

Intro

SQL-Friendly Style Guide for AppSheet

AppSheet’s naming restrictions for columns and tables are much more relaxed than SQL databases, and will allow using reserved words, spaces, and even special characters. This speeds up development by eliminating the need for separate Column Names and Display Names, in most cases.

However, migrating an app from Google Sheets to an SQL database becomes much more difficult when tables and columns have to be renamed, templates updated, etc. That can be very time consuming in larger apps, which tend to be the ones that need SQL databases. Furthermore, these larger apps are more likely to have multiple developers.

Purpose

The purpose of this Style Guide is to:

  • avoid table & column names that would cause SQL migration issues, and
  • define a consistent standard for naming all elements, which will
  • ease future maintenance in multi-developer environments.

Smaller, single developer apps that will never need an SQL database would probably benefit from using more relaxed naming conventions, instead, to avoid needing separate Display-Names.

General

Best Practices for naming all elements

==Consistency is the key!==

UpperCamelCase, lowerCamelCase, snake_case, etc., are style choices that are SQL-compatible. Just pick a standard and stick to it.

Do

  • use short (preferably 1-2 word) but descriptive names
  • ensure the name is unique and does not exist as a reserved keyword
  • keep the length to a maximum of 30 characters
  • begin names with a letter
  • only use letters, numbers and underscores in names
  • use underscores where you would naturally include a space in the name
  • 'first name' becomes [first_name]
  • avoid abbreviations and if you have to use them make sure they are commonly understood
  • use plural form for List/EnumList
  • [related_invoices], or [selected_options]
Don't
  • use SQL Reserved Words (alone)
  • use [approved_date] vs [date]
  • use plurals except for lists/EnumLists:
  • instead, use the more natural, collective-term where possible
  • i.e. [staff] vs [employees], or [people] vs [individuals]
    • When a collective term does not exist, use singular table names
  • [User] vs [Users]
  • use a table name as a column name (except Ref’s), & vice versa invoice[invoice_num]
  • end names with an underscore_

Data

Special care should be taken when selecting table and column names for apps that may one day be migrated to an SQL database. Other sections of this guide are purely for style/ consistency, but the Data section is critical for future SQL compatibility.

Tables

Do

  • Name join-tables using terms that describe the relationship
  • [registration] vs [student_class]
Don't
  • name join-tables by combining table-names

    Columns

    Do

  • ** Use Uniform suffixes:** __time _date, _at, _on, _by (created/edited) _
  • Name all Ref-type columns with the same name as the table- not the key.
  • [client].[name] vs [client_id].[name]
  • Consistently name all keys in all tables:
  • [id], [key], or {table}_id
Don't
  • attempt to use sequential keys (unless table is read-only for all users)
  • use App Formulas for sheet columns when Initial Value + Reset on Edit would be safer.
  • include table names in column names invoice[invoice_number]

Slices

Do

  • include the table name AND reason for the slice
    • active_client vs active
Don't
  • asdf
  • asdf

UX

General

All top-level parent tables should have matching icons/format rules applied to:

  • the label (whatever that happens to be, name, Invoice#, etc), and-
  • primary views for that table,
  • actions associated with that table, where appropriate (LINKTO*)

For App-Users, this provides a visual link between rows, views, buttons, etc.- to clearly indicate they are all part of the same table. And for developers, the consistent visual cues will aid in navigating the editor.

Views

Do

  • Follow AppSheet's system view naming convention:
  • {table/slice_name}_{view_type}
  • Customer_Form, Product_Detail, etc
  • Avoid spaces & special characters
  • Select an appropriate icon for all views (instead of default)
  • add display names to all system 'Detail' views, to indicate 'Table/Slice Name'
    Don't
  • asdf
    • asdf

📌 - Tip: By using the format {table/slice_name}_{view_type}, the table/slice name can be determined with INDEX(SPLIT(CONEXT(View),"_"),1)

Format Rules

Do

  • Include table/slice-name and reason for rule (color, status, etc)

  • Rule Name: Active Client Red

  • Add an icon to the label for all 'parent tables'

  • 👤 customer[name], 🧾invoice[number]

  • Use that same icon for the views. Be consistent!

  • Don't
  • 'stack' rules with matching conditions and rely on ordering for the intended result. Be more specific with the rule conditions so that only one is true.

  •  

Behavior

General

Do

  • All names should consist of at least two words in the format Verb-Noun:
  • SAVE FILE, OPEN URL, DELETE USER
  • Always select appropriate icon, even for hidden Actions, Views, etc
  • Use Different names for the Workflow/Report/Process, and their individual Actions/Tasks.

(Analogous to using a table-name for a column-name)

Don't
  • asdf

  • asdf

  • Actions & Tasks

    Do

  • Indicate the Action/Task type (by name, or at least implied)

  • Send Email, View Site (Go to website-implied), Set Status* (Change Data-implied)*

  • always select an appropriate action icon, even for hidden actions

  •  
Don't
  • asdf
  • asdf

    Workflows, Reports & Processes

    Do

For Workflows, Reports & Processes that contain a single Action/Task:

  • Include the Action/Task name, but don't copy it exactly
  • i.e. WF: 'Send Email: Welcome Letter', Action: 'Send Email'

For multiple Actions/Tasks

  • use a name that describes the entire set of Tasks/Actions
  • i.e. WF: 'New User Onboarding', Actions: 'Add User', 'Send Email'
Don't
  • use a workflow where an action, grouped action, form submit action, etc- would work, and not require a network connection to sync
  • asdf
  • Expressions

    General

    Expression formatting does not affect SQL compatibility. The guidelines in this section are intended to aid in readability, future maintenance and consistency.

    Do

  • Use ALL CAPS for all AppSheet function names
  • USERSETTINGS(), SELECT(), [_THISROW], etc
  • Use UpperCamelCase for function with a fixed list of AppSheet defined parameters (Quotes optional, because these never have spaces):
  • CONTEXT(ViewType), CONTEXT("AppName"),
  • Use double quotes on all other strings, even when not required
  • LINKTOVIEW("User_Form")
  • Add Line Returns and Tabs for readability
SELECT(staff[name],
  AND(
    [department]="Operations",
    [status] ="Active",
    [shift] ="Days"
  )
)
Don't
  • use a single line for expressions with multiple functions or conditions
  • re-use the same SELECT()/FILTER() expression in multiple places

(make a Slice, instead)

  • add 'expensive' Virtual Columns just to display a total, average, etc.- unless realtime data is needed (consider a Report, instead)
  • nest multiple versions of the same sub-expression just to change one input.

Tip: create a separate Virtual Column or Slice for the sub-expression, then reference it in the main expression for easier readability.

This is genius! Well, I was referring to something like that with my question. I could classify it as a solution but it would close this spectacular debate that was put together. So we're going to give it some time for community members to come up with ideas. Your work is very good.

Brilliant! Thank you for sharing!


@Marc_Dillon wrote:

I've certainly developed my own set of standards


💯


@Gustavo_Eduardo wrote:

when passing the app to another developer, he prefers to redo it than fix it.

For this reason I thought of a Standard.


So, this is a "synchronization" between developers - one developer can simply pick up where the other left off kind of thing.

I agree that standards - both naming conventions and implementation patterns - will be very beneficial to inexperienced app creators to allow them to implement complicated ideas quickly.  Following them by any developer will help to more easily understand an implementation.

Of course the BIG problem is getting everyone to follow them.  

But let's also not forget, that even in the AppSheet platform, a very condensed programming platform, there is room for discovery of new ways to do things.  It is always good to deviate from the norm for that discovery.  I am frequently surprised by the innovative ways app creators find to solve problems.  The more of those we know, the easier it is to overcome those app stumbling problems in the future because we have more knowledge, more "tools", to deal with them!

Así es!! Bien dicho. Además, el que todos manejemos un "mismo idioma" sería incluso beneficioso para Appsheet porque ellos mismos podrían encontrar más rápidamente soluciones. 

Saludos @WillowMobileSys 

It may seem like a no-brainer, but maybe it will help someone like me. I found that by refreshing the page with the browser's refresh button, the app in the browser runs faster. I do it every time I feel that it has started to slow down because of the saved changes.

Top Labels in this Space