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
    • Re: Collections Cookbook: 50+ Visual Examples & Co...

    Re: Collections Cookbook: 50+ Visual Examples & Code

    01-08-2020 04:21 AM

    WackdeMack
    Resolver I
    36618 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    mdevaney
    mdevaney Community Champion
    Community Champion
    • 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
    40,613 Views
    141 Kudos
    Reply
    • All forum topics
    • Previous Topic
    • Next Topic
    • « Previous
      • 1
      • 2
      • 3
      • 4
    • Next »
    iAm_ManCat
    Super User iAm_ManCat
    Super User
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎01-06-2020 01:48 AM

    Awesome, this is a great collection of info 😹

    Thanks so much for sharing, I've just imported it into my environment as a reference for me to use 😺💜

     

    I've sent you a bunch of corrections too 🙀


    @iAm_ManCat
    My blog


    Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


    Thanks!
    You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
    Sancho Harker, MVP


    Message 2 of 36
    37,734 Views
    8 Kudos
    Reply
    mdevaney
    mdevaney Community Champion
    Community Champion
    In response to iAm_ManCat
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎01-06-2020 04:50 AM

    Thanks for helping me out with the bug fixes @iAm_ManCat.

     

    I've made the following adjustments to the app:

    Ex00 - Collections can have up to 2,000 rows if you increase the delegation limit
    Ex3 - ProductName is now showing the correct product
    Ex4 - ProductName is now showing the correct product
    Ex12 - Solution 12b is now showing 3 rows
    Ex14 - Changed Title To Top 3 Values
    Ex15 - Changed Title To Bottom 3 Values
    Ex20 - Fixed Date Formmtting Issue

    Message 3 of 36
    37,691 Views
    13 Kudos
    Reply
    oappdev
    oappdev Post Prodigy
    Post Prodigy
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎01-07-2020 04:11 AM

    @mdevaney Amazing Cookbook 👍 Thank you!

    Message 4 of 36
    37,005 Views
    3 Kudos
    Reply
    timl
    Super User timl
    Super User
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎01-07-2020 04:15 AM

    This is really fantastic - well done @mdevaney!!!

    Message 5 of 36
    37,002 Views
    3 Kudos
    Reply
    colonel_claypoo
    colonel_claypoo Advocate II
    Advocate II
    In response to timl
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎01-08-2020 03:32 AM

    Very much appreciated @mdevaney, thanks!

    Message 6 of 36
    36,637 Views
    3 Kudos
    Reply
    WackdeMack
    WackdeMack Resolver I
    Resolver I
    In response to colonel_claypoo
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎01-08-2020 04:21 AM

    Really helpfull, thanks for all the content! 

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

    ‎01-08-2020 03:06 PM

    @mdevaney thanks so much for the share. I will definitely be picking up some great tips for my apps ... I already have!

     

    Just for anyone, like me, who struggled a little to download and open this app, I followed along with this solution:

    https://powerusers.microsoft.com/t5/Building-Power-Apps/How-To-Open-MSApp-Files/td-p/184953

     

    Since then, I've setup a shortcut to the PowerApps Studio, which I didn't have before 🙂 

    Message 8 of 36
    36,492 Views
    10 Kudos
    Reply
    poweractivate
    Super User poweractivate
    Super User
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎01-08-2020 03:07 PM

    @mdevaney 

     

    Great job, thank you for this well crafted resource.

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

    ‎01-09-2020 12:51 AM

    Love it! One of those page turners that just keeps giving 😀

    Fantastic work

    Message 10 of 36
    36,422 Views
    3 Kudos
    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