• Collection is a group of items or we can say a group of information

  • It can store a group of numbers. For example: [1,2,3]

  • It can store a group of strings. For example: ["a","b","c"]

  • It's a group of similar data

  • It can even save array of objects

    • [{Id: 1, Value: "India"},{Id: 2, Value: "US"},{Id: 3, Value: "UK"}]

    • (In Power Apps language, array of objects is called as Table of Records)

  • Collections get saved locally inside the Power Apps application

  • Collections are used when you want to store some information temporarily

  • If you refresh the app, the collection will be erased and you need to initiate it again

Methods to initialize a collection in Power Apps

  • We can use Collect or ClearCollect function to initialize the collection

  • Showing collection in a gallery
  • Adding a new item to a collection
  • Removing item from a collection
  • Clearing a collection

How to access collection and it's elements
  • First function - to read first element/record of the collection
  • Last function - to read last element/record of the collection
  • FirstN function - to access first N elements/records of the collection
  • LastN function - to access last N elements/records of the collection