Find One - Fetch a Single Record From the Database

This is a component to indicate select operation on the set of data sources in the process.

To retrieve a single record from a given table, use the Find One command.

Example: To fetch the latest single value of temperature and humidity from the sensor data table.

Steps:

  1. Click + under the database operations to create a database operation.

  2. Enter the name of the operation and select Type as FindOne.

  3. Click OK. The new component is created and displayed in the designer.

    Image 1

  4. Click Edit in the top menu to open the Properties Panel.

  5. Navigate to Properties > Data Source and select the required data source. You can create a new data source such as SQL Data Source under Settings.

  6. Click Properties > Instruction to open the editor to write the SELECT SQL Instruction.

    Image 2

  7. Write down the SQL Instruction in the editor and click OK.

    Image 3

  8. Alternatively, you may 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, meaning the parameter names must match the field Resource IDs in the entity schema.

  9. Click SAVE to save the configuration.

    Image 4