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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Reset numbering in Pow...
Power Apps
Answered

Reset numbering in Power Apps (gallery)

(0) ShareShare
ReportReport
Posted on by 25

Hi All!

 

I'm creating a Control Plan app (Process-Checklist Overview). The data I'm using comes from a SharePoint List and Library.

 

Info about the SP List Columns:
• Process info (Title)
• Process Step
• Process sub step
• Lookup column to find the corresponding Checklist in a SharePoint library.

 

My question:

The numbering in the SharePoint list is not sequential. See screenshot image as example:

Gerard___0-1711051943185.png

 


In my app I have a gallery where I want to show all items with step and sub step.


However, the smallest step number should appear as Step 1. The next one is Step 2, and so on.

And if a step number appears more than once, I want to include the sub step.


Same story then goes for my sub step, Lowest number should be 1. The next 2, and so on.

Result from the included image should thus be: 1 -> 2.1 -> 2.2 -> 3.

So far I used the following, but that results in sequential numbering:


ForAll( Sequence(CountRows(CollAllChecklists_NoRowNumber)), Patch( Last(FirstN(CollAllChecklists_NoRowNumber, Value)), {RowNumber: Value} ) )

Anybody how can help me out?! Any help would be greatly appreciated!

Categories:
I have the same question (0)
  • Verified answer
    DJ_Jamba Profile Picture
    2,837 Moderator on at

    Hi @Gerard__ 


    I recreated your example in a SP list and added a few more rows for testing.

     

    DJ_Jamba_0-1711081234796.png

     

    Then I created a collection to display the gallery items in the way you wanted to see them. You can use that collection to display the gallery and/or update the source table.

    Clear(col_RenumberSteps);
    ForAll(
     Sort(
     Filter(
     CLOverview,
     StepNumber > 0
     ),
     StepNumber
     ),
     If(
     CountRows(col_RenumberSteps) = 0,
     Collect(
     col_RenumberSteps,
     {
     Title: Title,
     OrigStep: StepNumber,
     NewStep: CountRows(col_RenumberSteps) + 1,
     OrigSubStep: SubStep,
     NewSubStep: If(
     !IsBlank(SubStep),
     1
     )
     }
     ),
     If(
     StepNumber <> Last(col_RenumberSteps).OrigStep,
     Collect(
     col_RenumberSteps,
     {
     Title: Title,
     OrigStep: StepNumber,
     NewStep: Last(col_RenumberSteps).NewStep + 1,
     OrigSubStep: SubStep,
     NewSubStep: If(
     !IsBlank(SubStep),
     1
     )
     }
     ),
     Collect(
     col_RenumberSteps,
     {
     Title: Title,
     OrigStep: StepNumber,
     NewStep: Last(col_RenumberSteps).NewStep,
     OrigSubStep: SubStep,
     NewSubStep: CountRows(
     Filter(
     col_RenumberSteps,
     OrigStep = StepNumber
     )
     ) + 1
     }
     )
     )
     )
    )

     

    The result is this:

    DJ_Jamba_1-1711081507021.png

    The values in the brackets are the original source values so you can see the correct renumbering.

    Can you do anything with this?

     

  • Gerard__ Profile Picture
    25 on at

    @DJ_Jamba,

     

    Thanks for your reply. This looks very promising. I'll give it a try and recreate this in my app.

    For now I have one question:

    Why are you filtering the SP list on StepNumber > 0? Just to exclude those that haven't been filled out?

     

  • Gerard__ Profile Picture
    25 on at

    @DJ_Jamba, it works like a charm! Thank you so much!

  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    @Gerard__ 
    Simply because it's bad practice to connect to a datasource without attempting some kind of filter

  • DJ_Jamba Profile Picture
    2,837 Moderator on at

    Awesome and you're welcome!

    d(-_-)b

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard