In this Power Apps Tutorial, we’ll go over how to use the Power Apps list box control with a SharePoint list. In addition, we will cover powerapps listbox items from sharepoint list. Examples include:
- Power Apps list box control from SharePoint list
- Power Apps Listbox populate from SharePoint choice column
- Power Apps list box control multiple columns
- Power Apps Listbox patch item to SharePoint list
- Power Apps Listbox saves multiple items to the SharePoint list
- Power Apps Listbox update SharePoint list
Before working with Power Apps list box control using SharePoint list, we have to prepare a SharePoint list. As a result, we can use that list as our data source.
Suppose, we have prepared a SharePoint list named IT Sectors that have some columns such as Sector (Single line text), and Country (Choice column) shown below:
Now, we will build a canvas app on the Power Apps and connect this SharePoint list to the canvas app. To connect the above list to Power Apps, the following steps are:
- On the Power App screen, navigate to the Add data.
- Search SharePoint, and select SharePoint connector.
- Select the SharePoint site address.
- Select the desired SharePoint site.
- Choose the specified SharePoint list.
- Connect.
Now, we can find this data source in the Add data section.
This is how to connect a SharePoint data source to the Power Apps environment.
Power Apps list box control from SharePoint list
Here, we will see how to build a Power Apps list box control from the SharePoint list. Let’s populate a Power Apps list box control using the above SharePoint list’s Sector column. To build this, the following steps are:
- On the Power Apps screen, add a List box control. Navigate to the Insert tab > Input > List box > Select. It will create a list box control with sample list box values i.e., 1,2,3.
- Insert the below expression on the Items property of the list box control.
Items = 'IT Sectors'.Sector
Where ‘IT Sectors‘ is the name of the data source i.e, SharePoint list and Sector is the name of the SharePoint column.
We can see, the data from the Sector column has been listed in the Power Apps List box control below:
This is how to populate a List box control from the SharePoint list within the Power Apps.
Read Power Apps combo box default value
PowerApps Listbox control from SharePoint choice column
Similarly, we will see how to build a Power Apps list box control using the data from the choice column of a SharePoint list.
Here, we will build a power Apps list box control using the above SharePoint choice column i.e., Country, and the following steps are:
- On the Power Apps screen, add a list box control.
- Insert the below expression into the list box’s Items property.
Items = Choices('IT Sectors'.Country)
Where ‘IT Sectors‘ is the name of the SharePoint data source name and Country is the Sharepoint choice field name. As we are using the ‘choice field’ so we need to use the column name within the choice().
Now, we can see all the items from the choice field have been added to the Power Apps list box control like below:
This is how to Power Apps Listbox populate from the SharePoint choice field
Power Apps list box control multiple columns
Do you want to work with the Power Apps list box control using multiple columns? But unfortunately, multi-valued fields are not supported by the PowerApps List Box control. Instead of using the List box control, we recommend you use a Power Apps Combo box control to work with multiple value fields.
Read Power Apps Combo box with SharePoint list
Power Apps Listbox patch to SharePoint list
Here, we will see how to patch the item(s) from the Power Apps List box control to the SharePoint list.
Case-1: Patch a single item from the Power Apps list box to SharePoint
In this case, we will see how to patch a single item from the Power Apps list box to the SharePoint list. To implement this requirement, the following steps are:
- On the Power Apps screen, we have built a dropdown control using the Sector column. For this, we have used the below expression on the Items property of the dropdown control.
Items = Distinct('IT Sectors',Sector)
- Next, add a list box control to the Power Apps screen and insert the below expression on the Items property to display the data from the country column.
Items = Choices('IT Sectors'.Country)
- To patch the selected item from the Power Apps controls (i.e., Dropdown and Listbox) to the SharePoint list, add a button control to the screen.
- Insert the below expression on the button’s OnSelect property.
OnSelect = Patch('IT Sectors', Defaults('IT Sectors'),{Sector:Sector_dpd.Selected.Result, Country: Country_Lst.Selected})
Where,
- ‘IT Sectors‘: The name of the SharePoint list.
- Sectors, Country: The name of the SharePoint column.
- Sector_dpd: The name of the dropdown control.
- Country_Lst: The name of the list box control.
Let’s save the app and preview it. Select items from both the dropdown control as well as the list box control. (Ex: Microsoft, UK). Click on the Patch button.
Now, we can see the item has been patched to the SharePoint list like below:
This is how to save an item from the Power Apps Listbox to the SharePoint list.
Read Power Apps combo box filter
Case-2: Patch multiple items from the Power Apps list box to SharePoint
Here, we will see how to patch multiple items from the Power Apps list box to the SharePoint list. To implement this, we will use the above Power Apps controls.
Also, set the toggle “On” to Allow multiple selections on the SharePoint list choice column i.e., Country.
Similarly, set the toggle ‘ON’ on the ‘Select Multiple’ property of the Power Apps list box control.
Then insert the below expression on the button’s OnSelect property to patch the multi-selected items from the Power Apps list box control to the SharePoint list.
Items = Patch('IT Sectors', Defaults('IT Sectors'),{Sector:Sector_dpd.Selected.Result, Country: Country_Lst.SelectedItems})
Let’s save it and select items from both the controls such as Sector as IBM, Country as the USA, and France. Then click on the Patch button.
Now, we can find the multi-selected items within the SharePoint list below:
This is how to patch the Power Apps list box multi-selected values to the SharePoint list.
Read How to Patch Power Apps Combo Box
Power Apps List box update SharePoint list
Here, we will see how to update an existing item from the Power Apps List box to the SharePoint list. Suppose, we have a gallery that retrieves the data from the specified SharePoint list and a list box control outside of the gallery.
When the user selects any gallery item and then click on any item from the Power Apps list box control, the changes will reflect in the Power Apps gallery as well as the SharePoint list.
For this, we will use the above SharePoint list i.e., IT Sectors, and the following steps are:
- On the Power Apps screen, build a vertical gallery using the specified SharePoint list.
- To highlight the selected item on the Power Apps gallery, insert the below expression on the gallery’s TemplateFill property.
TemplateFill = If(ThisItem.IsSelected, LightCyan, White)
- Build a Power Apps list box control to display the data from the SharePoint choice column i.e., Country.
- To update the selected gallery item with the Power Apps List box item, insert the following expression on the list box’s OnChange property.
OnChange = Patch('IT Sectors', ITSector_Gal.Selected,{Country: Lst_Country.Selected})
Where ITSector_Gal is the name of the Power Apps gallery and Lst_Country is the name of the list box control.
Let’s preview the app. Select an item from the Power Apps gallery and then choose any item from the Power Apps list box control. (EX: IBM > France).
We can see this modification on the SharePoint list below:
This is how to update an existing Sharepoint list item from the Power Apps Listbox.
Conclusion
From this Power Apps Tutorial, we learned how to bind Power Apps list box items from a SharePoint list based on different scenarios. Such as:
- Power Apps list box control from SharePoint list
- Power Apps Listbox populate from SharePoint choice column
- Power Apps list box control multiple columns
- Power Apps Listbox patch item to SharePoint list
- Power Apps Listbox saves multiple items to the SharePoint list
- Power Apps Listbox update SharePoint list
You may like the following Power Apps tutorials:
- Power Apps Checkbox control within Gallery
- How to Reset Power Apps Date Picker
- How to Sort Combo Box Items in Power Apps
- Power Apps Cascading Dropdown Control
- How to Set Default Value in Power Apps Dropdown
- How to use Power Apps Gallery Dropdown
- Power Apps Gallery Group By
- How To Set Default Value in Power Apps List Box Control
- Power Apps Timer Control Examples
After working for more than 15 years in Microsoft technologies like SharePoint, Office 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Out audiences are from the United States, Canada, United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a SharePoint MVP(8 times), check out My MVP Profile. I have also worked in companies like HP, TCS, KPIT, etc.