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
- You have a FL0 account.
- You've read Creating records.
Step 1: Create a flow
- Create an HTTP Request flow.
- In the Explorer pane, click Create new.
- Select Flow.
- Type Get Tasks.
- Tap the Return key.
- When a dialog appears, select HTTP Request.
- Open the Start component.
- From the Method dropdown, select GET.
- In the Path field, enter /tasks.
- Click the X icon to close the component.
- Click Save.


Step 2: Add a "Select" component to the flow
- Drag a Select component into the flow.
- Select the component to open it.
- From the Table dropdown, select Todo > Tasks.
- In the Select column, enable all of the fields.
- Click the X icon to close the component.
- Click Save.


Step 3: Add an "End" component to the flow
- Drag an End component into the Get Tasks flow.
- Select the component to open it.
- From the Status Code dropdown, select 200 OK.
- From the Content Type dropdown, select application/json.
- In the Body field, select Select > Data.
- Click the X icon to close the component.
- Click Save.


Step 4: Run the flow
- Open the Run panel.
- 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.


Updated 8 months ago