# Create several identical connected records

> Turn a quantity into that many connected records, for example 5 order items for a quantity of 5, with a workflow loop or the Record Looper pipe.

Source: https://tadabase.com/docs/pipes/record-looper-pipe-legacy  
Status: Verified Nov 17, 2026. Checked against the current product

When a customer orders 5 headphones, you may want 5 separate order item records, each connected to the order, instead of one record with a quantity of 5. A workflow can do this with a loop. The Record Looper pipe is the older way and does the same through the REST API.

## Create the records with a workflow

A workflow loop runs its steps once for each item in a list. Workflows have no "repeat N times" setting, so first make a list with one item per record you want, then loop over it.

1. **Start from the order** Create a workflow on the table that holds the quantity, for example Order Items or Orders, with the trigger you need, such as a record being created.
2. **Make the list** Add a **Run Custom Code** step that reads the quantity from the workflow's record and returns a list with that many items. See [Running custom JavaScript](https://tadabase.com/docs/workflows/running-custom-javascript).
3. **Add a loop** Add **Loop / Bulk Action**. Under **Items from**, choose the result of the Run Custom Code step.
4. **Create a record each time** Inside the loop, add **Create Record** (or **Create Connected Record**) for the order items table. Connect each new record to the order and set the product and a quantity of 1 under **Set field values**.
5. **Test it** Run the workflow on a record with a small quantity, such as 3, and check that 3 connected records appear.

> **Note:** If each record should come from an existing record, for example one per technician, loop over those records instead: under **Records from**, choose the table or the connected records. See [Create, update and copy records in a workflow](https://tadabase.com/docs/workflows/data-actions).

## Use the Record Looper pipe

Apps that already use the Record Looper pipe can keep it. Its call creates a number of identical records in one table, setting the fields you name to the values you give. It calls the Tadabase REST API, so it needs an API key.

1. **Create an API key** Open **Settings** > **API Keys**, click **Generate New Key**, turn on **Allow Updates** and click **Save**. See [Create and manage API keys](https://tadabase.com/docs/developers/getting-api-keys).
2. **Install the pipe** In the builder's left menu, click **Pipes** > **Install Pipe**, search for `Record Looper`, click it and click **Install**.
3. **Add the API credentials** In the installed pipe, open **Global Parameters**, enter your API key details and click **Save**.
4. **Check the call** Open **API Calls** to see the call and its parameters: the number of records, the table, and pairs of field slug and value. If the pipe is configurable, you can edit its request there to match your table.
5. **Run it from a workflow** Add **Trigger Pipe**, choose the call under **Pipe Method**, and set the **Parameters**, for example the number of records from the Quantity field.

- **Field slugs:** to see each field's slug, such as `field_46`, open the table's fields in the Data Builder and turn on **Show Field Slug**.
- **Connection fields:** set the value to the **record ID** of the record to connect to, not its display value.
