Find - Fetch List From a Database
Learn how to fetch a list of records from a database.
You can directly use an entity or can explicitly write an instruction. Use the following database operation to retrieve the data from one or more tables or views in a database operation.
Example: To fetch all the values of temperature and humidity from the sensor data table.
Steps:
Click + under database operations to create the new database operation.
Enter the name of the operation and select type Find.
Click OK. The new component is created and displayed in the designer.
Click Edit in the top menu to open the Properties Panel.
Navigate to Properties > Data Source and select the required data source. You can create a data source such as SQL Data Source under settings.
Click Properties > Instruction to open the editor to write the select SQL Instruction under the editor.
Write down the SQL Instruction in the editor and click OK.
Alternatively, you can leave the Instruction field blank and select an Entity in the Properties > Entity field. This generates the SELECT SQL based on the entity schema automatically. The input parameters are strongly typed to the target table, such as the names of the parameters must match the field Resource IDs in the entity schema.
Click SAVE to save the configuration.



