How To Use The Power Apps Sequence Function
Power Apps SEQUENCE Function Posted by - Matthew Devaney on - July 20, 2020 19 Comments Yesterday the SEQUENCE function was announced on Microsoft’s official...
- Published
- Reading time
- 3 min read
Before you start
Is this guide for you?
- Best entry point
- Power Apps
- Time investment
- 3 min read
Imported reference from Matthew Devaney's blog for learning purposes. Original: https://www.matthewdevaney.com/sequence-function-in-power-apps/. Author: Matthew Devaney.
Power Apps SEQUENCE Function Posted by - Matthew Devaney on - July 20, 2020 19 Comments
Yesterday the SEQUENCE function was announced on Microsoft’s official Power Apps blog . I thought I’d provide some details on how to use SEQUENCE since the Power Apps documentation does not yet include a page for it. Description
The SEQUENCE function creates a range of numbers as a single column table. This could be a continuous range like the numbers from 1-to-100 or non-continuous range such as [2, 4, 6, 8 10]. Ranges of dates and letters can be produced as well. Syntax Sequence( records, start, step)
records – Required. Quantity of numbers in the sequence.
start – Optional. Starting number of the sequence. Default is 1.
step – Optional. Incremental value. Default is 1 Examples Numbers A table with all numbers from 1-to-10 Sequence(10) Output: [1,2,3,4,5,6,7,8,9,10]
A table with all multiples of 10 from 0-to-100 Sequence(10, 0, 10)
Output: [0,10,20,30,40,50,60,70,80,90,100] A table with numbers from 10-to-1 Sequence(10, 10, -1) Output: [10,9,8,7,6,5,4,3,2,1] Letters A table of all letters A-to-Z
ForAll(Sequence(26, 65, 1), Char(Value))
Output: [A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z] Dates
A table of the next 7 days starting 2020-01-01
ForAll(Sequence( 7 ), Date ( 2020 , 1 , Value)) Code language: JavaScript ( javascript )
Output: [1/1/2020, 1/2/2020, 1/3/2020, 1/4/2020, 1/5/2020, 1/6/2020, 1/7/2020]
A table of the next 5 Saturdays starts 2020-01-04
ForAll(Sequence( 5 , 4 , 7 ), Date ( 2020 , 1 , Value)) Code language: JavaScript ( javascript )
Output: [1/4/2020, 1/11/2020, 1/18/2020, 1/25/2020, 2/1/2020]
A table of the first day of each month in the year 2020
ForAll(Sequence( 12 ), Date ( 2020 , Value, 1 )) Code language: JavaScript ( javascript )
Output: [1/1/2020, 2/1/2020, 3/1/2020, 4/1/2020, 5/1/2020, 6/1/2020, 7/1/2020, 8/1/2020, 9/1/2020, 10/1/2020, 11/1/2020, 12/1/2020]
A table of the last day of each month in the year 2020
ForAll(Sequence( 12 ), DateAdd( Date ( 2020 , Value, 1 ), 1 , Months) - 1 ) Code language: JavaScript ( javascript )
Output: [1/31/2020, 2/29/2020, 3/31/2020, 4/30/2020, 5/31/2020, 6/30/2020, 7/30/2020, 8/31/2020, 9/30/2020, 10/31/2020, 11/30/2020, 12/31/2020]
A table of all of the days in the month of January for the year 2020
ForAll(Sequence(Day(DateAdd( Date ( 2020 , 1 , 1 ), 1 , Months) -1 ), 1 , 1 ), Date ( 2020 , 1 , Value)) Code language: JavaScript ( javascript )
Output: [1/1/2020, 1/2/2020, 1/3/2020, 1/4/2020, 1/5/2020, 1/6/2020, 1/7/2020, 1/8/2020, 1/9/2020, 1/10/2020, 1/11/2020, 1/12/2020, 1/13/2020, 1/14/2020, 1/15/2020, 1/16/2020, 1/17/2020, 1/18/2020, 1/19/2020, 1/20/2020, 1/21/2020, 1/22/2020, 1/23/2020, 1/24/2020, 1/25/2020, 1/26/2020, 1/27/2020, 1/28/2020, 1/29/2020, 1/30/2020, 1/31/2020] Random A random number between 1-and-100
First ( Shuffle ( Sequence (1, 100, 1))) .Value Code language: CSS ( css )
Output: 67 (changes to another random number each time) Did You Enjoy This Article? 😺
Subscribe to get new Copilot Studio articles sent to your inbox each week for FREE Enter your email address Sign Me Up Questions?
If you have any questions or feedback about the Power Apps SEQUENCE function please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion. ADDCOLUMNS function Collections DATE functions SEQUENCE function SHUFFLE function Matthew Devaney M365 Copilot Power Apps
How To Create Copilot Custom UI Widgets In Power Apps
Tagged
Power Apps
Have a Microsoft 365 topic idea?
Share article suggestions, community session ideas, corrections, or real-world scenarios for future nextM365 learning notes.
Keep learning Microsoft 365
Explore more practical guides for SharePoint, Power Platform, Copilot Studio, migration, automation, governance, and security.
Continue learning
Related tutorials
Related questions
Related comparisons
Next action