Deleting records

In FL0, the Delete component deletes one or more records from a database.

This tutorial uses a to-do list management application as an example to demonstrate how to delete 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 Delete Task.
    4. Tap the Return key.
    5. When a dialog appears, select HTTP Request.
  2. Open the Start component.
  3. From the Method dropdown, select DELETE.
  4. In the URL field, enter /task.
  5. Create a query parameter for specifying the ID of a task.
    1. Under Query String, click the + icon.
    2. In the Name field, enter id.
    3. Enable the Required option.
  6. Click the X icon to close the component.
  7. Click Save.

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

  1. Drag a Delete component into the flow.
  2. Select the component to open it.
  3. From the Table dropdown, select Tasks.
  4. In the Row IDs field, select Start > QueryString: id.
  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 Delete Task 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 Delete > Data.
  6. Click the X icon to close the component.
  7. Click Save.

Step 4: Run the flow

  1. Open the Run panel.
  2. In the id field, enter the ID of a task.
  3. Click Run.

If you navigate to the database table, the specified record is deleted.