Skip to main content
Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

How to Create Array of numbers 0 to x via expressions - sequence()?

(0) ShareShare
ReportReport
Posted on by 4

Hi, 

 

I am assuming that the sequence() expression function does not work with flows? I would like to dynmically create an array of numbers based on the returned value for an api call but can't work out what the expression looks like. 

 

Thanks

  • tfraser Profile Picture
    177 on at
    Re: How to Create Array of numbers 0 to x via expressions - sequence()?

    It's a long time since this was asked but for anyone else looking for this in future I achieved this by first adding a 'compose' step with a range(start,count) expression then multiplying each item in the range by a factor equal to my desired interval using a 'select' step.

     

    This is very quick compared iterating a value and adding it to an array using a loop.

    tfraser_1-1673360956726.png

     

    tfraser_0-1673360902891.png

     

  • Verified answer
    v-bofeng-msft Profile Picture
    on at
    Re: How to Create Array of numbers 0 to x via expressions - sequence()?

    Hi @rjtedge :

    Power Automate currently does not have a function similar to sequence() in Power Apps.I am not sure how to achieve your needs through API, but I have an alternative method

    I've made a test for your reference:

    1\My Flow

    vbofengmsft_1-1624344567143.png

    vbofengmsft_2-1624344590902.png

    2\Run the flow

    vbofengmsft_0-1624344445455.png

    3\The result:

    vbofengmsft_3-1624344623925.png

    Best Regards,

    Bof

     

     

  • Paulie78 Profile Picture
    8,416 Super User 2025 Season 1 on at
    Re: How to Create Array of numbers 0 to x via expressions - sequence()?

    Either parameter can be dynamically driven by the output from previous steps. So you can use the value coming back from your API.

  • rjtedge Profile Picture
    4 on at
    Re: How to Create Array of numbers 0 to x via expressions - sequence()?

    That's a great start. Is there any way to change the interval so that the array is (0,10,20,30) etc?

  • Paulie78 Profile Picture
    8,416 Super User 2025 Season 1 on at
    Re: How to Create Array of numbers 0 to x via expressions - sequence()?

    Use the range expression:

    range(0,10)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1