Skip to content
Home » Index function in Power Apps

Index function in Power Apps

The Index function in Power Apps returns a record of a table based on its ordered position in the table.

Index returns an error if the requested record index is less than 1, greater than the number of records in the table, or the table is empty.

Syntax:

Index(Source, Index)
  • Table – Required. Table to operate on.
  • RecordIndex – Required. The index of the record to return. Record numbering begins with 1.

Usages of Index

Retrieving the specific record from collection

Suppose we have a collection named colEmpData that contains employee records, and the gallery is displaying all the records from this collection.

 

Suppose you want to retrieve the second record from a collection and display it in a gallery. You can use the following formula for that.

Index(colEmpData , 2)

You can see, it returns the second record from collection based on its ordered position.

 

Reteriving a specific record in a Table

You can also use the Index function to reterive a specific record from a Emp table, for that you can write below formula.

Index(Emp, 3)

This will return the 3rd record from Emp table based on its ordered position .

When to use Index function

Use the Index function when you need to retrieve specific records from a collection or table based on their position. It’s especially handy in scenarios where you need to reterive a particular record for display, user actions, data validation, or special handling within your app.

 

Read Also..

FirstN function

LastN function

 

Loading

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SQL BI Tutorials

Subscribe now to keep reading and get access to the full archive.

Continue reading