Are you familiar with Power Apps Dataverse choice column filtering options? Don’t think twice. We will learn everything there is to know about Microsoft Dataverse in this tutorial, including what Power Apps Dataverse Choices are, how to connect the Dataverse to Power Apps, and much more.
Additionally, the following connected topics will be covered:
- Display Dataverse Table Records in Power Apps Gallery
- Filter gallery by dataverse choice column
- Filter Choices in Power Apps
- How to filter dataverse choice column in powerapps
- Filter Dataverse Gallery with a Specific Choice
- Filter Dataverse Choice using Power Apps Combo Box
- Filter the Dataverse choice column by the text value
- Filter the Dataverse Choice Column by Dropdown
- How to get value of Choice field in Power Apps
- Power Apps get value of Choice field Dataverse
Power Apps Dataverse Choices
Let’s get started with Power Apps Dataverse Choices and how we can use this in Power Apps.
The below screenshot represents a Dataverse Table with several columns called Job Seekers Registration List. When we will go to the Columns section, then we can see all types of fields that are available in the dataverse table.
- Moreover, we can view there is a Dataverse Choice field called Gender. This gender field has four choice values: Male, Female, Transgender, and Others.
If you are new to Dataverse and do not know how to create a Choice field in a Dataverse table, then follow this link: Dataverse Create Choice Column
The Dataverse table resembles the below image and contains several records.
Let us start with how to filter dataverse choice column in Power Apps. Before that, we must connect the Dataverse table to Power Apps. See the sections below for details on connecting to the Dataverse and using Power Apps.
Also, Read: Dataverse Primary Name Column Autonumber
Connect Dataverse to Power Apps
Next thing we will see how to connect the Dataverse table to Power Apps.
- First, Sign in to Power Apps. Go to + Create from the left navigation and then choose Blank app.
- Next, click on the Create button under the Blank canvas app as shown below. Then provide a name to the app and choose the Format either Tablet or Mobile. Click on Create.
- To connect the Dataverse table (Job Seeker Registration List), go to the Home tab -> Click on the Data section (from left navigation) -> Tap on Add data button -> Choose the specific Dataverse table under the Tables section. Now the dataverse table has been added to Power Apps.
- Now go to the File tab and Save the app by providing the name (if you have not provided it before).
This is how to connect the Dataverse table to Power Apps.
Display Dataverse Table Records in Power Apps Gallery
Here, we will see how to display all the Dataverse table records in the Power Apps Gallery control.
- On the Power Apps screen, Insert a Power Apps Gallery control and set its Items property to the Dataverse table name as:
Items = 'Job Seekers Registration Lists'
Where,
‘Job Seekers Registration Lists‘ = Dataverse table name
You can provide the Layout, Font, Font Size, Background Color, and much more to the gallery as per your need.
This is the way to display Dataverse Table Records in the Power Apps Gallery control.
Also, check: Dataverse create table from SharePoint list
Filter Dataverse Gallery with a Specific Choice
Next, we will discuss how to filter the Dataverse Power Apps gallery with a particular choice value.
- Here, we will retrieve all the Dataverse Records that should match with the type of gender Male only and display them in the gallery control.
- To work around this, select the gallery control and set its Items property to the code below:
Items = Filter(
'Job Seekers Registration Lists',
Gender = 'Select Gender'.Male
)
- ‘Job Seekers Registration Lists‘ = Provide Dataverse table name
- Gender = Specify the choice column name
- ‘Select Gender‘ = It is the display name of the choice field where all the choice values are stored in the Dataverse table
- Male = Specify a choice value from the choice field that you want to filter
Refer to the screenshot below.
This is how to filter Dataverse Gallery with a Specific Choice value.
Filter Choices in Power Apps
To work with the Power Apps filter Choice column, you can refer to this complete Power Apps tutorial: PowerApps Gallery Control Filter Example
Filter Dataverse Choice using Power Apps Combo Box
Do you know how to filter the dataverse choice field using a Power Apps Combobox control? Check out the scenario below.
- The screenshot below represents a Power Apps Combobox control and a Gallery control. When a user chooses a specific gender from the combo box, the gallery filters and only shows the records that match their selection.
- For example, if I choose the gender as Female, then the gallery only shows information about items that are specific to the Female gender.
- To achieve this, set the Combobox Items property to the code below:
Items = Distinct(
'Job Seekers Registration Lists',
Gender
)
Where,
Distinct = This is a Power Apps function that helps to retrieve only the unique values
- Next, select the gallery control and set its Items property as:
Items = Filter(
'Job Seekers Registration Lists',
Gender = cbGender.Selected.Result
)
Where,
cbGender = Combo box control name
This is how to filter Dataverse Choice value using Power Apps Combo Box control.
Read: Delete All Records From Dataverse Table [With Examples]
Filter Dataverse Choice Column by the Text Value
Have you ever tried to use a text value to filter the dataverse choice field? Sometimes a user wants to filter the dataverse choice columns by the text of the choice values.
When we wish to filter an option column by a variable or other user input, it is a common business case scenario. However, it’s not fully simple to complete this task.
- Let’s imagine, for example, that we wish to get all entries whose Gender matches the text value “Others.” Due to a mismatch in data types, it is impossible to filter a choice column by a text value, as one might assume.
- You can refer to the screenshot below where the code is correct but it is not executing in the Power Apps Gallery control and not showing any proper result.
- Similarly, a choice value cannot be matched based on a choice item that we return from a call to LookUp. Unfortunately, it utilizes syntax that is conceptually valid and that I would predict working.
- In the image below, you can see, that whenever we are implementing the below code in the gallery’s Items property, this code is throwing an error as “Incompatible types for comparison. These types can’t be compared: OptionSetValue(Select Gender), Record.“
Items = Filter('Job Seekers Registration Lists',Gender=LookUp(Choices('Job Seekers Registration Lists'.Gender),Text(Value)="Others"))
Where,
- ‘Job Seekers Registration Lists’ = Dataverse Table name
- Gender = Dataverse Choice Column name
- Others = One of the choice values from the Dataverse choice field that we want to filter out
Solution:
As an alternative solution, we will use a Power Apps hidden Dropdown control. This is based on the idea that while a call to LookUp cannot be used to filter a choice column, it can be used to filter by the selected item in a dropdown.
- Let’s say we want to get records that match the gender type that a user types into the txtEnterGender text input control.
- Insert a Power Apps Dropdown control and set its Items property to the code below:
Items = Filter(
Choices('Job Seekers Registration Lists'.Gender),
Text(Value) = txtEnterGender.Text
)
Where,
- ‘Job Seekers Registration Lists’ = Dataverse Table name
- Gender = Dataverse Choice Column name
- txtEnterGender = Text input control name
- Text(Value) = PowerApps Function name that helps to convert a Choice to Text. To know more about this function, refer to this complete tutorial: Power Apps Value Function
- Once we applied the code to Dropdown, we need to set the Visible property to false or off. So that nobody can see this Dropdown control in the app.
- Next, apply the code below on the gallery’s Items property:
Items = Filter(
'Job Seekers Registration Lists',
Gender = ddSelGender.Selected.Value
)
Where,
ddSelGender = Dropdown control name
- Finally, save, publish, and preview the app. The user may now enter any gender type value at runtime into the text input control, and the gallery control will display entries that match as shown below.
This is how to filter the Dataverse Choice Column by the Text Value.
Check: How to Upload images to Dataverse from Power Apps
Filter the Dataverse Choice Column by Dropdown
Next comes how we can filter the Dataverse Choice field by a Power Apps Dropdown control.
- As in the image below, you can see there is a Dropdown control and a Gallery control. When a user selects a Gender type (suppose Others), the gallery filters and displays item information specific to the user’s selected gender (Others).
- To work with this, set the code below on Dropdown’s Items property as:
Items = Choices('Job Seekers Registration Lists'.Gender)
Where,
Choices = This Power Apps function helps to return a table of the possible values for a lookup column.
- Next, set the Gallery’s Items property to the below formula:
Items = Filter(
'Job Seekers Registration Lists',
Gender = ddGender.Selected.Value
)
Where,
ddGender = Dropdown control name
This is how to filter the Dataverse Choice Column by Dropdown control.
Power Apps get value of Choice field
Do you know what does mean for Power Apps get value of Choice field? Check out the simple example below.
- In Power Apps, there is a Dropdown control and a Data table control. The data table filters and shows just those user-selected record information when a user chooses a certain option value from the dropdown menu.
- Consider the following scenario: If we chose the Others option from the dropdown menu, the data table will only display entries that are of the Others gender.
- Select the Dropdown control and set its Items property as:
Items = Choices('Job Seekers Registration Lists'.Gender)
- Then, select the Data table and apply the formula below on its Items property:
Items = Filter(
'Job Seekers Registration Lists',
Gender = [@ddSelectGender].Selected.Value
)
Where,
ddSelectGender = Name of the Dropdown control
This is how to work with Power Apps get value of Choice field.
Check out: PowerApps toggle control + How to use with examples
Power Apps get value of Choice field Dataverse
This topic explains how to work with Power Apps to get the value of the Choice field Dataverse.
- A Power Apps dropdown control and a text input control are seen in the screenshot below. The dropdown control contains all the Dataverse Choice values: Male, Female, Others, and Transgender.
- Whenever a user will select the Dataverse choice value as Male and Female from the Dropdown menu, then the text input control will display a message like “Registration Successful”.
- Similarly, when a user will select the Dataverse choice value as Others and Transgender from the Dropdown menu, then the text input control will display a message like “Registration Unsuccessful“.
- To achieve this, set the Items property of the Dropdown control as:
Items = Choices('Job Seekers Registration Lists'.Gender)
Where,
Gender = Dataverse Choice Column Name
- Next, Select the Text input control and apply the code below on its Default property as:
Default = If(
ddChooseGender.Selected.Value = 'Select Gender'.Male,
"Registration Successful",
If(
ddChooseGender.Selected.Value = 'Select Gender'.Female,
"Registration Successful",
If(
ddChooseGender.Selected.Value = 'Select Gender'.Transgender,
"Registration Unsuccessful",
If(
ddChooseGender.Selected.Value = 'Select Gender'.Others,
"Registration Unsuccessful"
)
)
)
)
Where,
- ddChooseGender = Name of the Dropdown control
- ‘Select Gender’ = It is the display name of the choice field where all the choice values are stored in the Dataverse table
- Male, Female, Transgender, Others = These are the choice values that stored in the Select Gender field
- “Registration Successful“, “Registration Unsuccessful” = Messages that display in the text input control based on the condition
To learn more about the Power Apps Choices function, read this complete tutorial: Power Apps Choices Function with Examples
This is how to work with Power Apps get value of Choice field Dataverse.
Also, you may like some more Dataverse and Power Apps Tutorials:
- How to Create Dataverse View
- Dataverse Solution [Complete Tutorial]
- How to Create Dataverse File Field
- Upload PowerApps Attachments to SharePoint Library Folder
- PowerApps Weather
- Power Apps RSS Feed
- PowerApps Twitter Connector
- Power Apps Calculate + 13 Examples
This Microsoft Dataverse Tutorial illustrated what is Power Apps Dataverse Choices and how to work the dataverse Choice field in Power Apps. Also, we covered all these below-related topics:
- PowerApps dataverse choices
- Connect Dataverse to PowerApps
- Display Dataverse Table Records in Power Apps Gallery
- Filter gallery by dataverse choice column
- how to filter dataverse choice column in powerapps
- Filter Dataverse Gallery with a Specific Choice
- Working with Filter Dataverse Choice using Power Apps Combo Box
- Filter Dataverse choice column by the text value
- Working with Filter the Dataverse Choice Column by Dropdown
- How to get value of Choice field in Power Apps
- Power Apps get value of Choice field Dataverse
I am Bijay a Microsoft MVP (10 times – My MVP Profile) in SharePoint and have more than 17 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com