web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Sequence with multiple...
Power Apps
Unanswered

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:
I have the same question (0)
  • Kepcla Profile Picture
    on at

    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!

     

     

  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @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

    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!!

     

     

     

  • Verified answer
    CU-18081211-6 Profile Picture
    9,270 Moderator on at

    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

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

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard