Power Apps Combo box with SharePoint list

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.

  1. Power Apps Combo box with SharePoint list
  2. Power Apps combo box items from the SharePoint list
  3. Power Apps combo box save to SharePoint list
  4. Power Apps combo box SharePoint list distinct
  5. Power Apps multiple combo boxes Save items using two columns.
  6. Power Apps combo box SharePoint list choice
  7. Power Apps combo box multiple values to SharePoint list
  8. Power Apps combo box person field
  9. Power Apps combo box person DefaultSelectedItems
  10. Power Apps combo box person Image
  11. Power Apps combo box SharePoint list lookup
  12. Power Apps combo box SharePoint list filter
  13. Power Apps combo box defaultselecteditems SharePoint list
  14. 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.

Power Apps combo box SharePoint list
Power Apps combo box SharePoint list

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.

Power Apps combo box using SharePoint list
Power Apps combo box using SharePoint list

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.

Create a Power Apps Combo box using SharePoint list
PowerApps Combobox choices from SharePoint list

On the Combo box’s Items property insert the below expression to display the SharePoint column’s items.

Items = 'Job Openings'.Job_Location

Where,

  1. Job Openings: The name of the SharePoint list
  2. Job_Location: The name of the SharePoint column
Build Power Apps Combo box using SharePoint list
Build Power Apps Combo box using SharePoint list

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.
Error in save selected item to SharePoint in Power Apps Combo box
Error in saving the selected item to SharePoint in the Power Apps Combo box

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.

Power Apps combo box save item to SharePoint list
Power Apps combo box saves an item to the SharePoint list

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.

Power Apps combo box save to SharePoint list
Power Apps combo box save to SharePoint list

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.

Power Apps combo box save selected item to SharePoint list
Power Apps combo box save selected item to SharePoint list

This is how to save selected items from the combo box control to the SharePoint list via Power Apps.

See also  Power Automate Multilevel Approvals [Digital Purchase Order]

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.

Save Power Apps combo box data into SharePoint list
Save Power Apps combo box data into the SharePoint list

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})
Save Power Apps combobox item into Sharepoint list
Save Power Apps Combobox item into Sharepoint list

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.

Save Power Apps combobox selected item into Sharepoint list
Save Power Apps combo box selected item into Sharepoint list

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:

Power Apps combo box SharePoint list distinct
Power Apps combo box SharePoint list distinct

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.

Distinct values of a SharePoint list column with in Power Apps Combo box
Distinct values of a SharePoint list column in the Power Apps Combo box

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.

Power Apps multiple combo box using two columns
Power Apps multiple combo boxes using two columns
  • Similarly, we will add another combo box control to display the unique values of the Job_Location column.
Items = Distinct('Job Openings',Job_Location)
Power Apps build multiple combo box using two columns
Power Apps build multiple combo boxes using two columns
  • 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.

Power Apps Save items via multiple combo boxes using two columns
Power Apps Save items via multiple combo boxes using two columns

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.

Power Apps Save items using multiple combo boxes in two columns
Power Apps Save items using multiple combo boxes in two columns

We can find the selected items in the SharePoint list as shown below:

Power Apps save items from multiple combo boxes using two columns
Power Apps save items from multiple combo boxes using two columns

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.

Power Apps combo box SharePoint list choice
Power Apps combo box SharePoint list choice

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,

  1. Job Openings: The name of the SharePoint list.
  2. JobLocation: The name of the choice column.
Build Power Apps combo box using SharePoint list choice
Build Power Apps combo box using SharePoint list choice

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).

Power Apps combo box multiple value to SharePoint list
Power Apps combo box multiple values to SharePoint list

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.

Power Apps combo box save multiple value to SharePoint list
Power Apps combo box saves multiple values to the SharePoint list

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})
Power Apps Save multi select combo box to SharePoint List
Power Apps save multi-select combo box to SharePoint Lists
  • 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.
save multiple items from a Power Apps combo box in SharePoint
Save multiple items from a Power Apps combo box in SharePoint

This is how to save multiple items from a Power Apps combo box in the SharePoint list.

See also  How to display images within Power Apps from a 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.
Power Apps combo box person field
Power Apps combo box person field
  • 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})
  1. SearchUser: It enables retrieving the user profile search results.
  2. 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.
  3. Cmb_Manager: The name of the Combo box control.
  4. 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:

Person field in power apps via combo box control
Person field in power apps via combo box control
  • 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
Display Person field in Power Apps Combo Box
Display Person field in Power Apps Combo Box

Now, preview the app and we can see all the people fields within the Power Apps combo box control like below:

How to create a people picker in Power Apps Combo box control
How to create a people picker in Power Apps Combo box control

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,

  1. DisplayName: The name of the Office365 display name.
  2. Claims: A unique identifier that corresponds to a specific user
  3. Department: The user’s department
  4. Email: The user’s email
  5. JobTitle: The job title of the Office365 user’s
  6. 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:

Power Apps combo box person default selected items
Power Apps combo box person default selected items

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:

Power Apps combo box person Image
Power Apps combo box person Image

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
Power Apps combo box shows person Image
Power Apps combo box shows person Image
  • 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.
SharePoint People picker with user picture on Power Apps Combo box
SharePoint People picker with user picture on Power Apps Combo box

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:

Display Person field with image in Power Apps Combo Box
Display Person field with the image in Power Apps Combo Box

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.

Power Apps combo box SharePoint list lookup
Power Apps combo box SharePoint list lookup

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)
Power Apps combo box SharePoint lookup
Power Apps combo box SharePoint lookup

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.

power Apps combo box for SharePoint List lookup
power Apps combo box for SharePoint List lookup

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.

Power Apps combo box linked to a SharePoint list lookup column
Power Apps combo box linked to a SharePoint list lookup column

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.

Create a Power Apps Combo box using SharePoint lookup value
Create a Power Apps Combo box using SharePoint lookup value

Once we clicked on the Save button, we can see it will create a new item within the specified SharePoint list:

Build Power Apps combo box using SharePoint list lookup
Build Power Apps combo box using SharePoint list lookup

This is how to build Power Apps combo box using the SharePoint list lookup column.

See also  Power Apps Checkbox control within Gallery

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.

Power Apps combo box defaultselecteditems SharePoint list
Power Apps combo box defaultselecteditems SharePoint list

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:

Power Apps combo box SharePoint list filter
Power Apps combo box SharePoint list filter

Next, we will build a combo box control on that Power Apps screen to display the job location items.

SharePoint list filter based on Power Apps combo box
SharePoint list filter based on Power Apps combo box

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.

How to filter Power Apps combo box values from a SharePoint list
How to filter Power Apps combo box values from a SharePoint list

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)

How to filter SharePoint list data using Power Apps Combo box
How to filter SharePoint list data using Power Apps Combo box

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:

Power Apps combo box with numbers
Power Apps combo box with numbers

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:

Power Apps combo box with SharePoint number field
Power Apps combo box with SharePoint number field

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))
Power Apps combo box with number column
Power Apps combo box with number column

Let’s preview the control and we can see it will display the list of the values from the SharePoint number column.

Build Power Apps combo box using SharePoint list number column
Build Power Apps combo box using SharePoint list 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:

  • >