Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Re sequence numbered list

(0) ShareShare
ReportReport
Posted on by 725

Hi everyone

I'm thinking this is a forall and a collection thing, but I can't really figure how to bring it together.

In my Sharepoint list I have Procedures and each procedure has steps. In Powerapps, every time I add a new step(new record for that procedure) it will increment the step number for the given procedure. So some Procedures might have five steps and others 20+. So this all works great until I delete step 4 for example and instead of the following steps e.g 1,2,3,4,5 I would get 1,2,3,5. I was wondering how I could re sequence/ rewrite the numbers on my list straight after I delete a step giving me a result like 1,2,3,4.Capture SOP.PNG

Thank you for your time

  • BCBuizer Profile Picture
    22,007 Super User 2025 Season 1 on at
    Re: Re sequence numbered list

    Hi @Corissandageri ,

     

    I'm still surprised as well how seemingly complex things can be done with small formulas whereas seemingly simple things can take many, many lines of formulas.

     

    If my post resolved your issue, please mark it as the solution so other members of the community can find it more easily.

  • R Bakker Profile Picture
    725 on at
    Re: Re sequence numbered list

    Hi BCBuizer
    I didn't think this could be done with such minimal formula, The + icon was adding a step  in the wrong place, but then I remembered I had to sort my gallery. Thank you

  • BCBuizer Profile Picture
    22,007 Super User 2025 Season 1 on at
    Re: Re sequence numbered list

    Hi @Corissandageri ,

     

    In the below example I have added icons to the gallery that allow to insert or remove steps whilst updating the sequence numbers of the existing steps. Basically it relies on saving the number of the step to be added/removed in a local variable (locNumber), then updating the sequence number of the steps after the step to be added/removed and finally the adding/removal of the item itself:

     

    BCBuizer_0-1679344206665.png

    BCBuizer_1-1679344265977.png

     

    The references you probably will need to change to make this work for you are:

     

    ThisItem: this refers to the item to be added/removed, which may look like Gallery1.Selected

    colNumbers: this refers to the data source

    Number: this refers to the column in the data source that has the sequence numbers

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,605 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard