Reading multiple records

After inserting data into a database, the next step is to retrieve data from the database. You can do this by creating a flow and using a component to retrieve the data.

This tutorial uses a to-do list management application as an example to demonstrate how to retrieve multiple records from a database.

Prerequisites

Step 1: Create a flow

  1. Create an HTTP Request flow.
    1. In the Explorer pane, click Create new.
    2. Select Flow.
    3. Type Get Tasks.
    4. Tap the Return key.
    5. When a dialog appears, select HTTP Request.
  2. Open the Start component.
  3. From the Method dropdown, select GET.
  4. In the Path field, enter /tasks.
  5. Click the X icon to close the component.
  6. Click Save.

Step 2: Add a "Select" component to the flow

  1. Drag a Select component into the flow.
  2. Select the component to open it.
  3. From the Table dropdown, select Todo > Tasks.
  4. In the Select column, enable all of the fields.
  5. Click the X icon to close the component.
  6. Click Save.

Step 3: Add an "End" component to the flow

  1. Drag an End component into the Get Tasks flow.
  2. Select the component to open it.
  3. From the Status Code dropdown, select 200 OK.
  4. From the Content Type dropdown, select application/json.
  5. In the Body field, select Select > Data.
  6. Click the X icon to close the component.
  7. Click Save.

Step 4: Run the flow

  1. Open the Run panel.
  2. Click Run.

If the Show Debug option is enabled via the Output tab, the retrieved data — in this case, an array of tasks — appears in the logs.