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 / How to get the record'...
Power Apps
Answered

How to get the record's index number in the table

(0) ShareShare
ReportReport
Posted on by 13

collect(test, {demo:a}, {demo:b}, {demo:c});

I want to get index number of 1 for a;

I want to get index number of 2 for b;

I want to get index number of 3 for c;

How to get?

Categories:
  • Verified answer
    cdwhite Profile Picture
    1,069 Most Valuable Professional on at

    Hi @Camille666 ,

    With your collection created, you can add the following Power Fx to the items property of a gallery (for example) to get the row numbers/index:

    // Apply row number to collection
    Ungroup(
     ForAll(
     Sequence(CountRows(test)),
     {
     Record: Table(Index(test,Value)),
     RowNumber: Value
     }
     ),
     "Record"
    )

    If you needed the indexed values in a collection, you could do something like:

    // Build test collection
    ClearCollect(test, {demo:"a"}, {demo:"b"}, {demo:"c"});
    
    // Apply row number to collection
    ClearCollect(testIndexed,
    Ungroup(
     ForAll(
     Sequence(CountRows(test)),
     {
     Record: Table(Index(test,Value)),
     RowNumber: Value
     }
     ),
     "Record"
    ))

    ------------------------------------------------------------------------------------------------------------------------------
    If I've answered your question, please mark your post as Solved. You can accept more than one post as a solution.

    If my response was a good one, please give it a Thumbs Up!

    Visit my blog: https://platformsofpower.net

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 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard