In this Power Apps tutorial, we will discuss, how to use Power Apps combo box with SharePoint list with various examples. We will see an example of how to get PowerApps Combobox choices from SharePoint list. Here are the things we are covering.
- Power Apps Combo box with SharePoint list
- Power Apps combo box items from the SharePoint list
- Power Apps combo box save to SharePoint list
- Power Apps combo box SharePoint list distinct
- Power Apps multiple combo boxes Save items using two columns.
- Power Apps combo box SharePoint list choice
- Power Apps combo box multiple values to SharePoint list
- Power Apps combo box person field
- Power Apps combo box person DefaultSelectedItems
- Power Apps combo box person Image
- Power Apps combo box SharePoint list lookup
- Power Apps combo box SharePoint list filter
- Power Apps combo box defaultselecteditems SharePoint list
- Power Apps combo box with numbers
If you are new to Power Apps combo box control, check out an article on what a Power Apps Combo box control is and how to use its properties.
Power Apps combo box items from the SharePoint list
If you want to know how to work with the Power Apps Combo box using the SharePoint list, then this example will help you get your answer. We will create a Combo box using a specific SharePoint list column within Power Apps.
Before that, we need to prepare a SharePoint list. So we have prepared a SharePoint list named Job Openings having a title(default) and a single-line text column i.e. Job_Location to use that as our data source in Power Apps.
Using the above SharePoint list, we’ll create a Power Apps Combo box control that only contains the Job Location column’s items.
To do this, we need to connect the above SharePoint list to the Power Apps. On the Power App screen, click on the +Add data > Type SharePoint on the Search bar > Select the SharePoint connector and configure it with the specified list > Connect.
Once the SharePoint list is connected to the Power Apps, let’s add a combo box control to the screen. Click on the +Insert > Input > Combo box > Select. It will appear as a blank combo box with items such as Item1, Item2, Item3, etc.
On the Combo box’s Items property insert the below expression to display the SharePoint column’s items.
Items = 'Job Openings'.Job_Location
Where,
- Job Openings: The name of the SharePoint list
- Job_Location: The name of the SharePoint column
This is how to build a Power Apps Combo box control using a SharePoint list.
Power Apps Combo box save to SharePoint list
In this section, we will see how to build a combo box within the Power Apps that save the selected item to the SharePoint list. To implement this requirement, we are going to use the above example of Power Apps Combobox that contains a SharePoint column’s items as well as the SharePoint list named ‘Job Openings.‘
Example-1: Using Default required field
As per the requirement, when the user selects any item from the Power Apps combo box control, it will save the selected item within the SharePoint list. To do this, we will insert the below expression on the Combo box’s OnSelect property.
OnSelect = Patch('Job Openings',Defaults('Job Openings'),{Job_Location: Cmb_Job_Location.Selected.Job_Location})
Where,
- Job Openings: The name of the SharePoint list
- Job_Location: The name of SharePoint’s single-line text column
- Cmb_Job_Location: The name of the combo box control.
However, when we inserted the above expression, we received the error ‘Title: Field ‘Title’ is required, as shown in the screenshot. Technically, the formula is correct; however, there is an error. It states that the Title field is required, which means that in order to save the selected item, we must include the Title field as well as the Job Location.
Because the Title field in the specified SharePoint list is set to Required (You can get it from List settings), we must insert the values for both columns.
To achieve our goal, we will insert a static value into the Title column and allow the Job_Location value to be chosen from the combo box control. For this, we will replace the below expression on the combo box’s OnSelect property:
OnSelect = Patch('Job Openings',Defaults('Job Openings'),{Title:"PowerApps Developer", Job_Location: Cmb_Job_Location.Selected.Job_Location})
Where Title is the required SharePoint list’s column name and ‘Power Apps Developer‘ is a static value.
Let’s save the app and publish it. Play the app in preview mode. Suppose we select Mexico from the combo box control. We can see, the item will be saved in the SharePoint list like below.
This is how to save selected items from the combo box control to the SharePoint list via Power Apps.
Example-2: Removing Required from the field
In this example, we will see how to save the selected items from the Power Apps Combo Box control to the SharePoint list without using the Title column. The following steps are
Here, we will remove the required option from the SharePoint list’s Title field and then refresh the data source in the Power App.
Then insert the below expression within the combo box’s OnSelect property. As a result, it will only save the item from the Combo box to the SharePoint list column.
OnSelect = Patch('Job Openings',Defaults('Job Openings'),{Job_Location: Cmb_Job_Location.Selected.Job_Location})
Now, play the app in preview mode and select an item from the combo box control (Ex- Berlin). We can see, it will save the data only in the Job_Location column and with a blank value in the Title field.
This is how to save the Power Apps combo box selected item into the Sharepoint list.
Read Power Apps Cascading Dropdown Control
Power Apps combo box SharePoint list distinct
Here, we will see how to build a Power Apps Combo box control with SharePoint list distinct values. Suppose, we have created a Combo box control within the Power Apps that has some duplicate values such as:
However, we only want to display the unique values with the above combo box control because that is what we need. Insert the following expression into the Items property of the combo box control to accomplish this.
Items = Distinct('Job Openings',Job_Location)
On the above expression, we have used the Distinct() to remove the duplicate values.
This is how to display distinct values of a SharePoint list column within the Power Apps Combo box.
Power Apps multiple combo boxes save items using two columns
In this section, we will see how to work with multiple combo boxes using two SharePoint columns, as well as how to save the selected data within the respective columns.
We are going to use the above SharePoint list to implement our requirements. The following steps are:
- On the Power Apps screen, let’s build a combo box control to display the items of the title field. Insert the below formula on the combo box’s Items property.
Items = Distinct('Job Openings',Title)
Where Title is the name of the SharePoint column name.
- Similarly, we will add another combo box control to display the unique values of the Job_Location column.
Items = Distinct('Job Openings',Job_Location)
- Now, we will insert a button control to the Power Apps screen and insert the below expression on the button’s OnSelect property to save the selected data from both the Power Apps Combo box controls to SharePoint columns.
OnSelect = Patch('Job Openings',Defaults('Job Openings'),{Title:Cmb_Job_Title.Selected.Result, Job_Location: Cmb_Job_Location.Selected.Result})
Where Cmb_Job_Title and Cmb_Job_Location are the names of the Power Apps Combo box control.
Now save and publish the app, then play it in preview mode. Let’s select items from both the combo box controls. (Ex: Azure TechLead, Lyon). Click on the Save button to save the data.
We can find the selected items in the SharePoint list as shown below:
This is how to save items from multiple PowerApps combo boxes using two SharePoint columns.
Read How to Filter Power Apps Dropdown Control
Power Apps combo box SharePoint list choice
Here, we will see how to use the SharePoint choice column within the Power Apps combo box control. Suppose, we have prepared a choice column named ‘JobLocation’ within a specific SharePoint list.
To use this choice column in a Power Apps combo box control, the following steps are:
- On the Power Apps screen, add a combo box control.
- Insert the below expression into the Items property of the Combo Box control. It will display all the choices within the combo box control.
Items = Choices('Job Openings'.JobLocation)
Where,
- Job Openings: The name of the SharePoint list.
- JobLocation: The name of the choice column.
This is how to build a Power Apps combo box using SharePoint list choice
Power Apps Combo box multiple values to SharePoint list
Now we will see how it works with the Power Apps combo box various values in the SharePoint list. That means we will build a Power Apps combo box control using a SharePoint list that saves numerous items.
We are going to use the above SharePoint list named ‘Job Openings’ where we have used Title, and JobLocation(choice field).
Set the choice column, i.e., JobLocation, as Allow multi-selection. For that, select the JobLocation column > Column Settings > Edit > Toggle “On” on the Allow Multiple Selections > Save.
Connect the SharePoint data source to the Power Apps, or if it already exists, then refresh the data source in the Power Apps. To save the multiple values from the combo box control to the SharePoint list, the following steps are:
- On the Power Apps screen, add a combo box control to the screen and insert the below expression on the Items property of the combo box control to display the Title field.
Items = Distinct('Job Openings',Title)
- Again, add another combo box control and insert the below expression on the combo box’s Items property to display the choices of the JobLocation.
Items = Choices('Job Openings'.JobLocation)
- Next, add a button control to the screen and rename the button control as Save.
- To save the multiple values to the SharePoint list, add the following expression to the button’s OnSelect property.
OnSelect = Patch('Job Openings',Defaults('Job Openings'),{Title:Cmb_Job_Title.Selected.Result, JobLocation: Cmb_Job_Location.SelectedItems})
- Save and publish the app. Then play the app in preview mode. Let’s select the data from the title combo box (ex: M365 Developer)and select multiple items (ex: Lyon, Berlin)from the job location combo box. Press the Save button.
This is how to save multiple items from a Power Apps combo box in the SharePoint list.
Read How to Work With Power Apps Dropdown Blank Values
Power Apps combo box person field
In this section, we will see how to build a people picker control in PowerApps combo box control without using any SharePoint data sources. We will accomplish this by utilizing the Office365 Users Data Source.
To build a Power Apps combo box control with a person field, the following steps are:
- On the Power Apps screen, add a connector named Office365Users.
- Now, add a combo box control to the Power Apps screen. Go to +Insert > Inputs > Combo box.
- Insert the below expression into the Combo box’s Items property.
Items = Office365Users.SearchUser({searchTerm:Cmb_Manager.SearchText,top:0})
- SearchUser: It enables retrieving the user profile search results.
- searchTerm:Cmb_Manager.SearchText: It specifies the text inside the combo box that should be searched. That means we must search for any user’s name in the combo box.
- Cmb_Manager: The name of the Combo box control.
- top:0:It specifies the maximum number of results to return. It is set to 0 by default, which means it will return all entries.
But we can see there is no data within the combo box control, once the formula is applied. And the control will appear like the below:
- To display the people list, we need to set the fields property on the right side properties panel. To do this, navigate to Field > Edit > set the Layout as Person.
- Next, set the below properties such:
- Primary text: DisplayName
- Secondary text: Mail
- SearchField: DisplayName
Now, preview the app and we can see all the people fields within the Power Apps combo box control like below:
This is how to create a people picker in Power Apps Combo box control.
Read How to Remove Duplicates in Power Apps Dropdown
Power Apps combo box person defaultSelecteditems
Here, we will see how to work with the Power Apps combo box person’s DefaultSelectedItems property. As per our requirement, we want to set the current user as DefaultSelectedItems on the Power Apps Combo Box control.
We are going to use the above combo box control that displays all the Office365 users of the respective organization. To implement our requirement, we need to insert the below expression on the combo box’s DefaultSelectedItems property.
Items = {
DisplayName: User().FullName,
Claims: "Office365Users.SearchUser" & Lower(User().Email),
Department: "",
Email: User().Email,
JobTitle: "",
Picture: ""
}
Where,
- DisplayName: The name of the Office365 display name.
- Claims: A unique identifier that corresponds to a specific user
- Department: The user’s department
- Email: The user’s email
- JobTitle: The job title of the Office365 user’s
- Picture: The picture of an Office365 user’s
Once the formula is applied to the DefaultSelectedItems property, we can see it will display the current user’s display name as the default selected item like below:
This is how to set the Power Apps combo box person default selected items.
Power Apps combo box person Image
Here, we will see how to display a person’s image within the Power Apps Combo box control. Suppose, we have a SharePoint list named i.e., Job Openings‘ which has a people picker column like below:
Now, we will build a combo box control using the above people column that will display the respective user’s images within the Power Apps Combo box control. To work with this scenario, the following steps are:
- On the Power Apps screen, add a combo box control and insert the below expression on the Items property to display the user’s name.
Items = Choices('Job Openings'.Recruiter_Manager)
- But, it will not display the list of users within the combo box. So, we need to set the Fields property like below:
- Layout: Person
- Image: Picture
- Primary text: DisplayName
- Secondarty text: Email
- SearchField: DisplayName
- But still, it will not display the person’s name. To work out this, we will create a collection on the Power Apps Screen’s OnVisible property to store the list of values for the Recruiter_Manager people column.
OnVisible = ClearCollect(CollRecruiters,ForAll('Job Openings',ThisRecord.Recruiter_Manager))
Where CollRecruiters is the name of the collection.
- Next, replace the combo box’s Items property with the CollRecruiters collection name.
Let’s preview the app to see the result. We can see it is displaying all the user’s images within the Power Apps Combo box control like below:
This is how to display the Person field with an image in the Power Apps Combo Box.
Power Apps combo box SharePoint list lookup
Here we will see how to build a Combo box control using the SharePoint lookup field and also, we will see how to work with this control within the PowerApps.
To work with this scenario, we have created a SharePoint list that has a lookup field named Organizer.
Go ahead to Power Apps where we will add a Combo box control to the screen. And insert the below expression on the Items property to display the list of the SharePoint lookup fields.
Items = Choices(Events.Organizer)
We’ll then add a text input and a button control to that screen. So that when the user clicks on the button control after inserting data into both the text input and combo box control, the data is saved to the SharePoint list.
To save the data, insert teh below expression within the button’s OnSelect property.
OnSelect = Patch(Events,Defaults(Events),{Title:Txt_Event.Text, Organizer: Cmb_Organizer.Selected})
Where Txt_Event and Cmb_Organizer are the names of the text input and combo box controls names respectively.
That’s it! Now preview the app and let’s add some data into the text input and combo box control. Ex: new product launch event, Microsoft.
Once we clicked on the Save button, we can see it will create a new item within the specified SharePoint list:
This is how to build Power Apps combo box using the SharePoint list lookup column.
Read How to Sort Power Apps Collection
Power Apps combo box defaultselecteditems SharePoint list
Here, we will see how to set a default selected items from a SharePoint list within the Power Apps combo box control. That means a default selected item will be visible before the user selecting any item.
To work with this scenario, we are going to use the above example of combo box control where we have used the SharePoint lookup column items. We want to make the first descending value of the combo box the default selected item. That is, when we sort the look-up field in descending or ascending order, the first value in the combo box control will be displayed.
For this, we need to insert the below expression on the DefaultSelectedItems property of the combo box control.
DefaultSelectedItems = First(
Sort(
'Job Openings',
JobLocation.Value,
Ascending
)
).JobLocation
Where JobLocation is the name of the SharePoint lookup column.
On the above screen, it is displaying the default selected item within the Power Apps combo box control.
This is how to set a defaultselecteditems based on SharePoint list inside the Power Apps combo box control.
Power Apps combo box SharePoint list filter
Here we will see how to display the filtered data on Power Apps based on combo box selected items that use the SharePoint list choice column. That means the SharePoint data source will be filtered based on the combo box selected item(s) within the Power Apps.
We are going to use the SharePoint list named Job Openings that we have created previously. Using that SharePoint list, we have created a vertical gallery within the Power Apps screen like below:
Next, we will build a combo box control on that Power Apps screen to display the job location items.
To filter the gallery as per the combo box selected item(s), insert the below expression within the gallery’s Items property like below:
Items = Filter('Job Openings',Or(JobLocation.Value=Last(FirstN(Cmb_Location.SelectedItems,1)).Value, JobLocation.Value=Last(FirstN(Cmb_Location.SelectedItems,2)).Value,JobLocation.Value=Last(FirstN(Cmb_Location.SelectedItems,3)).Value,JobLocation.Value=Last(FirstN(Cmb_Location.SelectedItems,4)).Value))
where Cmb_Location is the name of the Power Apps combo box control. We repeated the expression four times for each of the four items in the combo box control.
Now, save and publish the app. Play it in preview mode. Let’s select multiple items from the combo box control. We can see the gallery will display the filtered SharePoint data as per the comb box selections. (Ex-Lyon, Chicago)
This is how to filter SharePoint list data using the Power Apps Combo Box control.
Read How to Patch a Collection in Power Apps
Power Apps combo box with numbers
Here, we will see how to build a combo box control that contains the SharePoint number field.
Suppose, we have a number column within the SharePoint list like below:
Let’s build a combo box control using the above SharePoint number column inside the Power Apps screen. For this, we have used the below expression on the combo box Items property to remove the duplicate values.
Items = Distinct(Events, OrganizerID)
Where Events is the name of the SharePoint list and OrganizerID is the number column name.
Unfortunately, it will not display the numbers within the Power Apps Combo box control and it will come as blank like below:
To display the number field, we need to convert them into text format using Text(). So replace the Items property with the following expression:
Items = ForAll(Distinct(Events,OrganizerID),Text(Result))
Let’s preview the control and we can see it will display the list of the values from the SharePoint number column.
This is how to build Power Apps combo box using SharePoint list number column.
Conclusion
From this Power Apps tutorial, we learned all about how to work with Power Apps Combo Box control using SharePoint list based on various scenarios. such as:
- Power Apps combo box items from the SharePoint list
- Power Apps combo box save to SharePoint list
- Power Apps combo box SharePoint list distinct
- Power Apps multiple combo box using two columns
- Power Apps combo box SharePoint list choice
- Power Apps combo box multiple values to SharePoint list
- Power Apps combo box person field
- Power Apps combo box person default selected items
- Power Apps combo box person Image
- Power Apps combo box SharePoint list lookup
- Power Apps combo box SharePoint list filter
- Power Apps combo box defaultselecteditems SharePoint list
- Power Apps combo box with numbers
You may also like the following Power Apps tutorials:
- How to Patch Power Apps Combo Box
- How to Sort Combo Box Items in Power Apps
- How to Reset Power Apps Combo Box
- How to Set Default Value in Power Apps Dropdown
- How to use Power Apps Gallery Dropdown
- Power Apps Dropdown Control with SharePoint
- How to use Power Apps drop-down control?
- Power Apps Gallery Group By
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.
Can you share the update/default property value of the datacard as well. I am having issue saving multiple data
how many combo boxes we can use canvas app