A Basic Guide to Creating and Using Collections in PowerApps (2024)

Building collections in PowerApps is a great way to keep data, take it offline, manipulate data and batch it up to your data source of choice. For example, your company can use a PowerApps collection to store employee information and organize them by their names, positions, departments, and any other information you would like to use. Once you've collected this data together, you can use it in a variety of ways to facilitate your organization's work. So, with that said, let's take a look at what you need to do in order to begin using a PowerApps collection.

Content:-

  • How to Create a Multicolumn Collection
  • Show a Collection
  • Remove One or All Items
  • How to Create a Connection to a SharePoint List
  • Put a SharePoint List Into a Collection
  • Conclusion

How to Create a Multicolumn Collection

  • In Power Apps Studio, add a Text input control.
  • Rename the control by selecting the ellipses in the left navigation pane, clicking Rename, and then typing ProductName.
  • Add a Drop down control.
  • Rename the Drop down control Colors, and then make sure that the Items property is selected in the property list.
  • In the formula bar, replace DropDownSample with this expression:
    1. ["Red", "Green", "Blue"]
  • Add a Button control, set its Text property to "Add", and set its OnSelect property to the following formula:
  • Collect( Productlist,
    {
    Product: ProductName.Text,
    Color: Colors.Selected.Value
    }
    )
  • Press F5 on your keyboard, type text intoProductName, select an option inColors, and then clickAdd.
  • Repeat the previous step at least two more times and then press Esc on your keyboard.
  • On theFile menu, selectCollections to show the collection that you created.

Now that you've done that, let's take a look at the steps you need to follow in order to show a collection and see that it's working.

Show a Collection

  1. Add a verticalGallerycontrol.
  2. Set the gallery'sItems property toProductList.
  3. In theData pane, set the subtitle field toColor, and set the title field toProduct.
  4. Close theDatapane, select the gallery, and then set theLayoutfield toTitle and subtitle.

You may find that the data you've added is wrong or it is unnecessary to track. If you find yourself in this situation, you'll need to be able to remove that information from your collection. Let's take a look at what you need to do in order to remove an item from your PowerApps collection.

Remove One or All Items

  1. Select the gallery template by clicking or tapping near the bottom of the gallery and then clicking/tapping the pencil icon near the upper-left corner.
  2. Add aTrash icon to the gallery template.
  3. Set the icon'sOnSelect property to this formula:
    • Remove(ProductList, ThisItem)
  4. Outside the gallery, add a button, set itsText property to"Clear", and set itsOnSelect property to this formula:
    • Clear(ProductList)
  5. While holding down the Alt key on your keyboard, select theTrash icon for an item to remove the item from the collection, or select theClear button to remove all items from the collection.

While you can work just with PowerApps, you also have the power to connect it to other Microsoft platforms. One great thing you can do is connect it to SharePoint. By connecting a SharePoint list to PowerApps, you can automatically port over the information you need to organize and use without having to transfer it manually. So, with that in mind, let's take a look at the steps you need to follow to create a connection with a SharePoint list.

How to Create a Connection to a SharePoint List

  1. Sign into PowerApps, select Data, thenConnections in the left navigation bar and then selectNew connection in the upper left corner.
  2. In the search box near the upper-right corner, type or pasteSharePoint, and then selectSharePoint.
  3. Perform either of these sets of steps:
    1. To connect to SharePoint Online, selectConnect directly (cloud services), selectCreate, and then provide credentials (if prompted). The connection is created, and you can add a data to an existing app or build an app from scratch.
    2. To connect to an on-premises site, selectConnect using on-premises data gateway. SpecifyWindowsas the authentication type, and then specify your credentials. (If your credentials include a domain name, specify it asdomain\alias.). UnderChoose a gateway, select the gateway that you want to use, and then selectCreate. The connection is created, and you can add a data to an existing app or build an app from scratch.

Now that you've created a connection between your SharePoint list and PowerApps, it's time to put that list into the collection you want to use. Let's take a look at the steps you need to follow in order to do that.

Put a SharePoint List Into a Collection

  1. Make sure you have connected a SharePoint list to PowerApps as explained above.
  2. Add a button, and set itsOnSelect property to the following function, replacingListName with the name of your SharePoint list:
    • Collect(MySPCollection, ListName)
    • This creates a collection namesMySPCollection and that contains the same data as your SharePoint list.
  3. While holding the Alt key on your keyboard, select the button.
  4. To preview the collection you've created, selectCollections on theFilemenu (This is optional).

A Basic Guide to Creating and Using Collections in PowerApps (1)

Conclusion

By following the instructions we've laid out, you should be ready to get started with the basics of creating and using collections in PowerApps. Now that you know the essentials, you should be ready to start learning the more advanced tools that PowerApps has to offer. Be sure to subscribe to Dock 365's blog and check back everyday for more tutorials on how to use Microsoft's wide array of productivity tools.

Book a Live demo

Schedule a live demo of Dock 365's Contract Management Software now.

A Basic Guide to Creating and Using Collections in PowerApps (2)

Written by Quentin Russell

Quentin Russell is a Content Specialist with knowledge of Content Marketing and Social Media Marketing.

A Basic Guide to Creating and Using Collections in PowerApps (2024)
Top Articles
Latest Posts
Article information

Author: Duane Harber

Last Updated:

Views: 6153

Rating: 4 / 5 (71 voted)

Reviews: 86% of readers found this page helpful

Author information

Name: Duane Harber

Birthday: 1999-10-17

Address: Apt. 404 9899 Magnolia Roads, Port Royceville, ID 78186

Phone: +186911129794335

Job: Human Hospitality Planner

Hobby: Listening to music, Orienteering, Knapping, Dance, Mountain biking, Fishing, Pottery

Introduction: My name is Duane Harber, I am a modern, clever, handsome, fair, agreeable, inexpensive, beautiful person who loves writing and wants to share my knowledge and understanding with you.