Skip to main content

Create Collection

Use the Create Collection step to initialise a named collection that subsequent steps can populate. On its own, the step produces an empty collection — combine it with one or more Add to Collection steps to build up the collection during execution.

Typical use cases include:

  • Collecting several record references (e.g. selected customers) for batch processing later in the flow.
  • Accumulating computed values across a loop so a later step can consume them as a list.
  • Preparing a dynamic payload for an HTTP Request or email step.

Configure the step

Open the flow editor, add Create Collection, and fill in the configuration card.

Description

  • Purpose: Explain what the collection is used for in this flow.
  • When to fill it: Always. The description is shown in the editor and execution history.
  • Tips: Include the business intent, for example, Collect invoice references for email attachment.

Collection Name

  • Purpose: The unique identifier for the collection within the flow.
  • When to fill it: Required. Subsequent Add to Collection steps reference the collection by this name.
  • Tips: Use a concise, descriptive name such as customers or invoiceLines.

Collection Type

  • Purpose: Determines what kind of items the collection will hold.
  • When to fill it: Required.
  • Options:
    • Value — the collection stores text values.
    • Reference — the collection stores record references (pointers to Business Central table records).

Table

  • Purpose: Specifies which Business Central table the references point to.
  • When to fill it: Required when Collection Type is Reference. Hidden otherwise.
  • Tips: Use the lookup to select the target table (e.g. Customer, Sales Header).

Outputs

The step registers one output that downstream steps can reference:

  • <Collection Name> — typed as value or reference depending on the configured Collection Type. For reference collections the output also carries the target table number.
note

When the flow runs, the Create Collection step does not write any data. The collection is physically created when the first item is added by an Add to Collection step; until then the collection does not exist in the execution context. The output is registered at design time so that subsequent steps can reference it.

If a downstream step reads the collection before any Add to Collection step has run, it sees the field as missing. Either gate that step on the loop that populates the collection, or default-handle the missing case in the consumer.

Best practices

  • Name collections clearly: Other steps reference the collection by name, so a descriptive name avoids confusion in complex flows.
  • Pair with Add to Collection: A Create Collection step without at least one Add to Collection step has no effect when the flow runs.
  • Keep types consistent: Choose the collection type up front. A single collection cannot mix values and references.