Skip to main content
Microsoft logo
Power Apps
    • AI Builder
    • Automate processes
    • Azure + Power Apps
    • Build apps
    • Connect data
    • Pages
    • Take a guided tour
  • Pricing
    • Overview
    • Become a Partner
    • Find a Partner
    • Find partner offers
    • Partner GTM Resources
    • Blog
    • Customer stories
    • Developer Plan
    • Documentation
    • For IT Leaders
    • Roadmap
    • Self-paced learning
    • Webinars
    • App development topics
    • Overview
    • Issues
    • Give feedback
    • Overview
    • Forums
    • Galleries
    • Submit ideas
    • User groups
    • Register
    • ·
    • Sign in
    • ·
    • Help
    Go To
    • Power Apps Community
    • Welcome to the Community!
    • News & Announcements
    • Get Help with Power Apps
    • Building Power Apps
    • Microsoft Dataverse
    • AI Builder
    • Power Apps Governance and Administering
    • Power Apps Pro Dev & ISV
    • Power Apps Portals
    • Connector Development
    • Power Query
    • GCC, GCCH, DoD - Federal App Makers (FAM)
    • Power Platform Integration - Better Together!
    • Power Platform Integrations
    • Power Platform and Dynamics 365 Integrations
    • Community Blog
    • Power Apps Community Blog
    • Galleries
    • Community Connections & How-To Videos
    • Community App Samples
    • Webinars and Video Gallery
    • Canvas Apps Components Samples
    • Kid Zone
    • Emergency Response Gallery
    • Events
    • 2021 MSBizAppsSummit Gallery
    • 2020 MSBizAppsSummit Gallery
    • 2019 MSBizAppsSummit Gallery
    • Community Engagement
    • Community Calls Conversations
    • Experimental
    • Error Handling
    • Power Apps Experimental Features
    • Community Support
    • Community Accounts & Registration
    • Using the Community
    • Community Feedback
    cancel
    Turn on suggestions
    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
    Showing results for 
    Search instead for 
    Did you mean: 
    • Power Apps Community
    • Galleries
    • Community App Samples
    • Collections Cookbook: 50+ Visual Examples & Code

    Collections Cookbook: 50+ Visual Examples & Code

    01-05-2020 20:42 PM - last edited 09-17-2020 09:44 AM

    Super User mdevaney
    Super User
    38893 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    mdevaney
    Super User mdevaney
    Super User
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    Collections Cookbook: 50+ Visual Examples & Code

    ‎01-05-2020 08:42 PM

    CollectionsCookBook_Top.png

     

    Welcome to the PowerApps “Collections Cookbook”.

    Inside you will find over 50 examples of how to do various tasks with Collections. Each page contains code and a visual to show what the code is doing.

    COPY + PASTE code from the cookbook into your own app.  Just change the Collection name and column names to match your own.

    Add the app to a Microsoft Teams tab for instant access.  I like to keep the Collections Cookbook close by while coding PowerApps.  That way I can quickly look for code to solve the problem I am having and the solutions are all in one place. 

     

    Calls To Action

    Give a Thumbs Up if you liked the app to make it easier for others to find in the gallery

    Post a reply for any suggestions for Collections Examples you want to see added in a future version.

    Send me a message for any bugs your encountered and I will try to fix them quickly

    Follow me on Twitter for more PowerApps tips https://twitter.com/mattbdevaney 

     

    Full List of Collections Examples

    Basics
    What Is A Collection?
    Create A Collection
    Create A Single Column Collection
    Insert A New Row
    Insert Multiple New Rows
    Change The Value In A Cell

    Selecting Data

    First Rows Of A Collection
    Last Rows Of A Collection
    Middle Rows Of A Collection
    Get A Column of Values
    Get Row Using LookUp On A Unique Value
    Get A Value In A Cell
    Filter A Collection
    Filter A Collection With AND Condition
    Filter A Collection OR Condition
    Ungroup A Table Within A Cell
    Get A Value From A Table Within A Cell

     

    Summarizing Data

    Calculate the Sum, Count, Average, Max, Min
    Group By And Sum Values
    Group By And Count Values
    Group By And Average Values
    Group By And Maximum Values
    Group By And Minimum Values
    Get The Rows With Top 10 Values
    Get The Rows With Bottom 10 Values
    Rank From Highest To Lowest With Ties
    Count The Unique Values In A Column
    Calculate the SumProduct of Two Columns
    Add A Column Showing Percentage Of Total

     

    Transforming Data

    Sort A Collection By One Or More Columns
    Join One Column From Another Collection
    Join All Columns From Another Collection
    Split A Text Column By Delimeter
    Merge Two Columns Into A Single Column
    Replace A Whole Row
    Replace All Values In A Column
    Fill Records With Missing Values
    Round The Values In A Column
    Randomly Shuffle The Order Of A Collection
    Fill Blanks In A Column With Last Non-Blank Value
    Add A Row Number Column
    Rename A Column
    Remove A Row
    Remove All Rows
    Remove One Or More Columns
    Remove All Columns Except
    Remove The Duplicates From 1 Column
    Remove The Duplicates From 2 Columns
    Get The Matching Values Within 2 Collections
    Change Date Format In A Column
    Stack Value From Multiple Columns In A Single Column

     

    Exporting Data

    Export Collection To A Datasource
    Export Collection To JSON
    Export Collection To CSV
    Export Collection To HTML Table

     

    (Screenshot Of The Menu)

    CollectionsCookBook_Menu.png

     

    I wish you the best of luck in building your PowerApp!

     

    Preview file
    196 KB
    Collections Cookbook 20200324.msapp
    Labels:
    • Labels:
    • Formulas and Controls
    • Offline App Design
    • clear
    • clearcollect
    • Collect
    • Collections
    • Collections Examples
    Message 1 of 36
    38,893 Views
    140 Kudos
    Reply
    • All forum topics
    • Previous Topic
    • Next Topic
    • « Previous
      • 1
      • 2
      • 3
      • 4
    • Next »
    Carike_B
    Carike_B Advocate I
    Advocate I
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎01-10-2020 05:39 AM

    Awesome resource, thank @mdevaney for putting this together!

    Message 11 of 36
    3,026 Views
    3 Kudos
    Reply
    powerrookie
    powerrookie Advocate I
    Advocate I
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎01-14-2020 07:45 AM

    Very useful! Thanks a lot!

    Message 12 of 36
    2,994 Views
    3 Kudos
    Reply
    kharina
    kharina Helper V
    Helper V
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎01-15-2020 11:29 PM

    Amazing! This is very much appreciated. 

     

    I hope that there will be an additional update about camera , image and add picture control too!!!!

     

    Kudos to @mdevaney !!!! 

    • Building Power Apps
    Message 13 of 36
    2,977 Views
    3 Kudos
    Reply
    poweractivate
    poweractivate
    MVP
    In response to Anonymous
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎01-16-2020 04:20 PM

    @Anonymous 

     

    Yes you are right, it is not the same as Zip package import.

     

    The technique here: How To Open .MSApp Files  is the one which would work for files attached in this showcase that are .msapp

    . 

    Message 14 of 36
    2,967 Views
    2 Kudos
    Reply
    mdevaney
    Super User mdevaney
    Super User
    In response to poweractivate
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎01-20-2020 05:24 PM

    Made two bug fixes and re-uploaded the msapp

     

    Ex4 - Add 2 Columns from another table
    Ex13 - Get The Last Rows

    Message 15 of 36
    2,913 Views
    5 Kudos
    Reply
    mdevaney
    Super User mdevaney
    Super User
    In response to mdevaney
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎03-12-2020 07:07 PM

    Improved this pattern

    Example 4 - Add 2 Columns from another table

     

    Now it is called

    Example 4 - Add All Columns from another table

     

    This way as many columns as are in the other table will be added... not just 2.

    Message 16 of 36
    2,781 Views
    5 Kudos
    Reply
    oappdev
    Super User oappdev
    Super User
    In response to mdevaney
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎03-13-2020 04:55 AM

    Thank you @mdevaney 

    Message 17 of 36
    2,766 Views
    3 Kudos
    Reply
    Anonymous
    Not applicable
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎04-04-2020 07:45 AM
    Excellent help!!!!!
    Message 18 of 36
    1,544 Views
    3 Kudos
    Reply
    Jonhnatam
    Jonhnatam
    Regular Visitor
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎04-14-2020 11:46 AM

    Excelent. 

    Message 19 of 36
    1,010 Views
    1 Kudo
    Reply
    Jonhnatam
    Jonhnatam
    Regular Visitor
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎04-14-2020 12:20 PM

    Good afternoon,

     

    how to create a variable within an application and have a selection field and a quantity field?

    In this case, the total value below is the product of the item record selected by the user, at the value entered by the user.

    It is not possible to assemble a variable that reads the selection data of the registered item.

    Can you help me?

     

    Attached pictures.

    Preview file
    452 KB
    Preview file
    172 KB
    Preview file
    320 KB
    Message 20 of 36
    1,010 Views
    1 Kudo
    Reply
    • « Previous
      • 1
      • 2
      • 3
      • 4
    • Next »

    Power Platform

    • Overview
    • Power BI
    • Power Apps
    • Power Pages
    • Power Automate
    • Power Virtual Agents

    Browse

    • Sample apps
    • Services

    Downloads

    • Windows
    • iOS
    • Android

    Learn

    • Documentation
    • Support
    • Community
    • Give feedback
    • Blog
    • Partners

    • © 2023 Microsoft
    • Follow Power Apps
    • Privacy & cookies
    • Manage cookies
    • Terms of use
    • Trademarks
    California Consumer Privacy Act (CCPA) Opt-Out Icon Your California Privacy Choices