Basics
Last updated
Last updated
While you don't need profound knowledge in programming for composing many kinds of applications, you should definitely understand, how some fundamental things work.
The main principle of any application: it takes some data, makes a transformation that we want, and returns the result: sends it to another app, device, or shows on a dashboard.
Computer programs process data due to its type. Main types we can spectate in the inject component properties window. This component is able to imitate different input messages for the app.
The most useful for codless app composing data and message types are:
string - data as a text. For example, "Hello, mom!" is a string. It must be in quotes: "string" or 'string'.
number - integers and floats. Note that 1, 156, -10.67 are distinct numbers, but '1, 156, -10.67' is one string.
boolean - may be true or false, that's all. For example, an app that switches lights on when true (a button sends true when pressed).
timestamp - just an actual time in the format of number of seconds from a particular moment in 1970 till now. Useful for time-depended actions of the app.
J: expression - a valid expression in JavaScript language. For example:
[1, 2, 3, 'Hello, mom!', true, -43.2] is an array of elements (numbers, string, boolean). Elements are divided by commas and wrapped in square brackets.
{'sensor1': 1, 'sensor2': 'on', 'temperature': 76} is an object. This is a key: value pairs structure in curvy brackets.
Components in a flow receive and send messages - that is what connections between components provide.
Each message (msg) is an object with properties (keys) and values. The main property for messages is payload. An optional property is topic. These two are suggested by default in the inject component. And the debug component shows us msg.payload by default.
The simplest flow will create a payload and show it in debug.