Primal Lobo
What is Collect and ClearCollect in PowerApps

What is Collect and ClearCollect in Microsoft PowerApps

By Primal Lobo in Power Apps on Sep 23 2021
  • Mukesh Nailwal
    Nov, 2021 8

    The Collect function adds records to a data source. The items to be added can be:

    A single value: The value is placed in the Value field of a new record. All other properties are left blank.
    A record: Each named property is placed in the corresponding property of a new record. All other properties are left blank.
    A table: Each record of the table is added as a separate record of the data source as described above. The table isn’t added as a nested table to a record. To do this, wrap the table in a record first.

    The ClearCollect function deletes all the records from a collection. And then adds a different set of records to the same collection. With a single function, ClearCollect offers the combination of Clear and then Collect.

    ClearCollect returns the modified collection as a table. ClearCollect can only be used in a behavior formula.

    I hope this helps you!

    Thanks

    • 1
  • Mubashir Shaikh
    Nov, 2021 5

    Power Apps provides us feature to hold multiple values of same data type into one storage block, just like Array in other programming languages. Collections have rows, columns and cells just like a table in Excel does All values in a column must be of the same data type (example: text, number, date, true/false)Collect function is used to add data of similar data type into collection. Clear Collect function will remove all previous values and add new set of records.

    • 1


Most Popular Job Functions


MOST LIKED QUESTIONS