How can I select a field value from another table with select()?
=: select(table: 'table_name'; field: 'field_name'; where: 'field_name_id' = #id)
What does highlighting a parameter in yellow mean?
Yellow parameters are name-parameters — they expect the name of a table or the name of a field.
table — expects the name of a table.
field — expects the name of a field.
name in such fields can be specified directly, in which case it is enclosed in single quotes. Move the cursor between the quotes and you will be offered autocomplete. For field autocomplete to work, the table parameter must be filled in.
In creation functions like rowCreate, for example, a name-parameter is encountered, which is correctly filled in with double quotes. It will work either way, but it is good practice to adhere to the standard.
The name parameter can be set by code, for example here depending on the value of the status field:
=: select(table: $if_table; field: 'header_field')
if_table: if(condition: #status = 1; then: 'table_1'; else: 'table_2')
// table_1 and table_2 can be specified in double quotes as well, but it is good practice to use single quotes since they will be substituted into the table parameter later
What does bold mean?
Bold parameters are mandatory parameters. Without them, the function will not work and will return an error. Those that are not bold can be absent — they are optional.
What does underlining a parameter mean?
Underscoring a parameter means that it can be used multiple times. For example, in if where condition is a multiple parameter:
= : if(condition: #status = 1; condition: #payment > 0; then: true; else: false)
condition in if is applied sequentially from left to right — this is how all multiple parameters work.
What characters are offered to auto-fill table and field names?
name parameters are filled in using single quotes!