Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Sequence with multiple elements

(0) ShareShare
ReportReport
Posted on by

Hi Expert!

With the help of you guys, I made this collection, with 3 inputs, "From ID", "To ID" and "Sequence Start":

Kepcla_0-1698947403427.png

But when I try to add another sequence, for example, "From ID": 51721456, "To ID": 51721460, "Sequence Start": 16.

is not  working....any ideas how to add new a sequence to  this collection?

Much appreciated in advance !

 

Categories:
  • Kepcla Profile Picture
    on at
    Re: Sequence with multiple elements

    @gabibalaban it works fine! I just made a little change 

    TO : Last(newCollection).TO+2* Value

  • Verified answer
    CU-18081211-6 Profile Picture
    9,266 Super User 2025 Season 1 on at
    Re: Sequence with multiple elements

    Just a mistype from your side.

    With(
    {
    iterationCount:Round(Value(TextInput5_3.Text)-Value(TextInput2_3.Text))/2)
    },

    Collect(newCollection,

    ForAll(Sequence(iterationCount),

    {
    'ID':Value(TextInput2_3.Text)+(Value-1)*,

    'FROM': Last(newCollection).TO+2*(Value-1),
    'TO': Last(newCollection).FROM+2* Value

    }
    )
    )

     

  • Kepcla Profile Picture
    on at
    Re: Sequence with multiple elements

    HI @gabibalaban ,

    almost achieved the scenario, the first part it works with your code (see image 1):

    Kepcla_0-1698980826598.png

    But when I try to add new set of values, the FROM and TO columns, they do not increase by 2 as they should (see image 2), only the ID column works fine.

    Kepcla_1-1698980956349.png

     

    This is your code that I used, but collecting data instead:

     

    With(
    {
    iterationCount:Round(Value(TextInput5_3.Text)-Value(TextInput2_3.Text))/2)
    },

    Collect(newCollection,

    ForAll(Sequence(iterationCount),

    {
    'ID':Value(TextInput2_3.Text)+(Value-1)*1,

    'FROM': Last(newCollection).TO+2,
    'TO': Last(newCollection).FROM+2

    }
    )
    )

     

    Thanks in advance!!

     

     

     

  • CU-18081211-6 Profile Picture
    9,266 Super User 2025 Season 1 on at
    Re: Sequence with multiple elements

    @Kepcla ,

    It is not clear to me if you want to add to existing collection values or to populate the collection with new values. Also I guess that you have somewhere on the screen a button to control the moment when the collection is populated.
    The formula in OnSelect property of the button should be:

    With(

        {

         iterationCount:

          Round(Value(ToIDTextInput.Text)-Value(FromIDTextInput.Text))/2)

        },

        ClearCollect(newCollection,

        ForAll(Sequence(iterationCount),

                {
                  ‘From ID’:Value(FromIDTextInput.Text)+(Value-1)*2,

    ‘To ID’:(Value-1)*2,

    Sequence:Value*2

             }

       )

    )

    Hope it helps !     

     

  • Kepcla Profile Picture
    on at
    Re: Sequence with multiple elements

    I @Mudassar_SZ365 

    I made a mistake explaining the scenario...The FROM - TO text input box, generate the column "ID"

     And "Sequence Start" text input box, generate the column FROM and TO (2 in 2)

    Kepcla_0-1698953702071.png

    I have a button to create the collection, but I can´t collect/add a new sequence below the current collection...

    For example, I would enter the new values ​​in the text input boxes, and I should get this, but below the current collection.

    Kepcla_1-1698954297215.png

     

    I hope you understand the scenario a little better.

    Best regards!

     

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,635 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard