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 / Re sequence numbered list
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

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    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

  • R Bakker Profile Picture
    725 on at

    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,505 Super User 2025 Season 2 on at

    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.

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