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 / Help with Patching a r...
Power Apps
Answered

Help with Patching a row number to an existing column instead of Adding New Column

(0) ShareShare
ReportReport
Posted on by 55

I know how to generate a Row Number by adding a column, but how do I add it to an existing column. 

 

In this one it adds a column called RowNumber, but what if RowNumber already exists in the Source and I want to add rownumbers that will Dynamically Change?

 

 

Clear(colNumberedInvoices);
ForAll(Invoices, 
 Collect(colNumberedInvoices,
 Last(FirstN(AddColumns(Invoices,
 "RowNumber",
 CountRows(colNumberedInvoices)+1
 ), 
 CountRows(colNumberedInvoices)+1
 )
 ) 
 )
)

 

 

 

Categories:
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    try

    Clear(colNumberedInvoices);
    // Row number code
    Collect(colNumberedInvoices,
    Ungroup(
     ForAll(
     Sequence(CountRows(Invoices)),
     {
     myRecord: Table(Last(FirstN(Invoices,Value))),
     RowNumber: Value
     }
     ),
     "myRecord"
    )
    )

     

    see Matthew Devaney - Add a Row Number to a Collection for further explanation

  • becca51180 Profile Picture
    55 on at

    That worked awesome and even faster than the For All method! Thank you so much!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard