<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=612681139262614&amp;ev=PageView&amp;noscript=1">
Skip to content

Need help? Talk to an expert: phone(904) 638-5743

Power Apps: Working With Power Apps Collection Basics [Power Platform Series - Ep. 12]

Power Apps: Working With Power Apps Collection Basics [Power Platform Series - Ep. 12]

In this tutorial, Matt Peterson, a trainer at Pragmatic Works, walks through how to use collections in Power Apps Canvas Apps to improve user experience and streamline data entry. Drawing from a real-world scenario, Matt demonstrates how predefined comments can be quickly selected by users instead of manually typed, making applications more efficient and user-friendly.


Introduction to Collections in Power Apps

Matt Peterson begins by explaining the purpose of collections in Power Apps. Collections allow developers to temporarily store data in-memory, making it easier to manipulate and reuse within an app. In this case, collections are used to store predefined comments that users can select when filling out a form.

Setting Up the Example Application

Using a park inspection app as an example, Matt shows how to enhance a form by adding suggested comments. Instead of requiring users to type repetitive feedback, the app provides selectable options.

  • A form is already created for submitting park inspections.
  • The goal is to allow users to quickly add comments such as “Needs landscape maintenance” or “Vandalism present.”
  • This is achieved by integrating a gallery and collections.

Creating a Data Source with the Table Function

Matt introduces the Table function to define static records that will serve as the data source for the gallery.

  • A blank vertical gallery is inserted into the app.
  • The default data source is replaced with a custom table.
  • Sample records include:
    • Needs landscape maintenance
    • Vandalism present
    • All looks good

This approach allows developers to quickly define reusable comment options without relying on an external database.

Enhancing the Gallery with Checkboxes

Next, Matt Peterson demonstrates how to make the gallery interactive by adding checkboxes.

  • A checkbox is inserted into the gallery’s template cell.
  • The checkbox text is dynamically set using ThisItem.Comment.
  • Users can now select predefined comments directly from the list.

Using the Collect Function to Store Selections

To capture user selections, Matt uses the Collect function.

  • The OnCheck property of the checkbox is configured.
  • A collection named colComments is created.
  • Each selected item is added to the collection.

This effectively builds a temporary dataset of user-selected comments.

Displaying Selected Comments with Concat

Matt then shows how to display the selected comments inside a form field using the Concat function.

  • The comments data card is unlocked.
  • The default value is replaced with a Concat formula.
  • The collection is used as the data source.
  • Comments are combined into a single string with separators.

This allows multiple selected comments to appear seamlessly in one input field.

Fixing Common Issues

Matt Peterson addresses several common issues that arise when working with collections:

  1. Checkboxes Remaining Selected
    • Solution: Use the Clear function in the screen’s OnVisible property.
    • This resets the collection when the screen loads.
  2. Checkbox State Not Syncing
    • Solution: Use the ThisItem in colComments logic in the Default property.
    • This ensures checkboxes reflect the actual collection state.
  3. Unchecked Items Not Removed
    • Solution: Use the Remove function in the OnUncheck property.
    • This removes specific items from the collection when deselected.

Final Result and Benefits

By the end of the demonstration, Matt successfully creates a fully functional system where users can:

  • Select predefined comments using checkboxes
  • Automatically populate form fields
  • Reset selections for new entries
  • Dynamically add or remove comments

Matt compares this process to a “shopping cart” experience, where users pick items and submit them all at once.

Conclusion

Matt Peterson highlights how collections can significantly improve usability in Power Apps. By reducing manual input and enabling quick selections, developers can create more efficient and intuitive applications. He encourages viewers to explore more use cases for collections and continue learning through Pragmatic Works’ training resources.

 Don't forget to check out the Pragmatic Works' on-demand learning platform for more insightful content and training sessions on Power Apps  and other Microsoft applications. Be sure to subscribe to the Pragmatic Works YouTube channel to stay up-to-date on the latest tips and tricks.  

Sign-up now and get instant access

Leave a comment

Free Community Plan

On-demand learning

Most Recent

private training

Hackathons, enterprise training, virtual monitoring