Tutorials/Power Apps/Dynamic Numeric and Date Sequences with the SEQUENCE Function
Power Appsintermediate

Dynamic Numeric and Date Sequences with the SEQUENCE Function

Generate custom number ranges, date series, and alphanumeric patterns in Power Apps using SEQUENCE – with practical examples and performance insights.

NA
Narmer Abader
@narmer · Published June 3, 2026

The SEQUENCE function has quietly become one of the most useful tools for generating structured data inside Power Apps. Instead of manually building a collection of numbers, you can now produce a single‑column table of values with a single formula – and from there create date ranges, alphabetical lists, padded IDs, and even random selections. This article explains the syntax, walks through a real‑world scenario, and shares tips to keep your apps lean.

Function Syntax at a Glance

SEQUENCE( Records [, Start [, Step ] ] )
  • Records (Required) – The number of rows you want in the table.
  • Start (Optional) – The first value of the sequence. Default is 1.
  • Step (Optional) – The amount added to each successive row. Default is 1.

The result is a single‑column table with the column name Value.

Code Tip

The simplest call: Sequence(5) returns [1, 2, 3, 4, 5]. To start at 100 and count down by 10: Sequence(5, 100, -10) returns [100, 90, 80, 70, 60]. The Records count must be in the range 0 to 50,000. Fractional values are rounded down (e.g., Sequence(0.9) returns an empty table).

Building a Dynamic Schedule – A Step‑by‑Step Example

Imagine you are creating a training tracker for a logistics company. Each training session must have a unique ID (like TR-101, TR-102, …) and a scheduled date that falls on the first Monday of the next 10 weeks.

First, store the start date in a variable:

powerfxSet the starting Monday
Set(StartMonday, Date(2026, 6, 8));  // adjust as needed

Then use Sequence(10) to generate the row numbers and ForAll to combine them with calculated dates:

powerfxGenerate session IDs and dates
ClearCollect(
  TrainingSessions,
  ForAll(
      Sequence(10),
      {
          SessionID: "TR-" & Text(100 + Value, "000"),
          ScheduleDate: DateAdd(StartMonday, (Value - 1) * 7)
      }
  )
);

Result – a collection with 10 records:

  • TR-101, 2026-06-08
  • TR-102, 2026-06-15
  • … up to TR-110, 2026-08-10

Practical Sequence Patterns

Numeric

Generate every number from 0 to 100 in steps of 10:

powerfxMultiples of 10
Sequence(11, 0, 10)

Create a descending list of odd numbers from 19 down to 1:

powerfxDescending odds
Sequence(10, 19, -2)

Date

Produce the first day of each quarter in 2026. The quarter-start months are 1, 4, 7, 10 — a sequence starting at 1 with a step of 3:

powerfxQuarter start dates
// Produces: Q1 Jan 1, Q2 Apr 1, Q3 Jul 1, Q4 Oct 1
ForAll(
  Sequence(4, 1, 3),
  {
      QuarterLabel: "Q" & Text(RoundUp(Value / 3, 0)),
      StartDate: Date(2026, Value, 1)
  }
)

The RoundUp(Value / 3, 0) maps month numbers 1→Q1, 4→Q2, 7→Q3, 10→Q4, giving readable quarter labels instead of raw month numbers.

List the next 14 days (including today) and filter out weekends:

powerfxWeekday-only dates (illustrative)
// Show only Monday–Friday in the next two weeks
Filter(
  ForAll(Sequence(14), {Date: Today() + Value}),
  Weekday(Date) in [2,3,4,5,6]
)

Alphabet

Obtain the letters A–Z:

powerfxUppercase alphabet
ForAll(Sequence(26), Char(64 + Value)).Value

Combine this with numeric padding to build product codes like CAT‑A01:

powerfxCustom alphanumeric IDs
ForAll(
  Sequence(5, 1, 1),
  {
      ProductCode: "CAT-" & Char(64 + Value) & Text(Value, "00")
  }
)

Random (without Duplicates)

Need 10 unique random numbers between 1 and 100? Shuffle the whole sequence and take the first rows:

powerfx10 random numbers, no repeats
Take(Shuffle(Sequence(100, 1, 1)), 10)

Performance and Delegation

  • SEQUENCE is evaluated on the server only when its result is passed to a delegable data source. However, if you use it inside ForAll that writes to a collection, all work happens client‑side.
  • Very large sequences (e.g., Sequence(5000)) can slow down the app, especially when combined with ForAll. Keep the Records parameter below a few hundred unless your scenario absolutely requires more.
  • When generating a single random value, prefer Rand() or RandBetween() directly – they are lighter than First(Shuffle(Sequence(…))).
Don’t overdo it

A sequence of 10 000 rows will consume significant memory and may cause the app to become unresponsive. Always test with a realistic maximum.

Avoiding Common Mistakes

  • Forgetting the column name – The resulting table uses Value as its column. In galleries or ForAll, refer to ThisRecord.Value or just Value when the scope is clear.
  • Assuming a scalar returnSequence(1) still returns a table, not a number. Use First(Sequence(1)).Value to get a single numeric value.
  • Non‑whole steps0.5 works, but be aware that number formatting in labels might need the Text function for clean display.
  • Step direction – If you specify a negative step, make sure Start is logically consistent (e.g., start at 10, step -1).

Final Thoughts

SEQUENCE replaces many manual Collect loops and lets you craft dynamic lists of numbers, dates, and codes with remarkable brevity. Whether you need a simple index for a gallery or a full calendar of future Fridays, this function makes the task clean and maintainable.

For performance, keep the record count reasonable and test with your largest expected data set. When combined with ForAll, Filter, and date arithmetic, SEQUENCE becomes a foundation block for many data‑generation tasks.

References