In this Power Apps Dataverse tutorial, We will discuss Power Apps Get Value Of Choice Field Dataverse.
Also, we will cover the topics below:
- How to get a specific Dataverse choice value using Power Apps Label Control
- How to get a Dataverse choice value using Power Apps Combobox Control
- How to retrieve a Dataverse choice value using Power Apps Dropdown Control
Read: How to Display Dataverse Choices in Power Apps Gallery
Power Apps Get Value Of Choice Field Dataverse
At first, Power Apps Get Value Of Choice Field Dataverse what does this mean? Let’s understand this first.
- I have a Dataverse table named Patient Registrations. This table has various columns along with a Choice column called Reason.
- This Reason choice column is having with all these below choice values like High Blood Pressure, Diabetes, Heart Issues, etc. Where the Patient Disease Reasons is my Choice Display name.
NOTE:
Don’t know how to create a Choice Column in Dataverse? No worries. Refer this complete tutorial to know everything about Dataverse Choice Column.
- Moreover, the Dataverse table (Patient Registrations) has some below records:
- Now I would like to get a specific Dataverse Choice value in Power Apps. For example, Gene Gorg is a patient whose symptoms include High Blood Pressure and a Cold. I want to retrieve this patient’s specific choice values using Power Apps.
We can achieve this need by using some of the Power Apps input controls like:
- Get a specific Dataverse Choice Value using Power Apps Label Control
- Get a specific Dataverse Choice Value using Power Apps Combobox Control
- Get a specific Dataverse Choice Value using Power Apps Dropdown Contol
Get a specific Dataverse Choice Value using Power Apps Label Control
Here, we will see how to get a specific Dataverse Choice value using a Power Apps Label control.
In Power Apps, insert a Label control (where you want to display the patient disease reason) and apply the code below on its Text property as:
NOTE:
Make sure to connect the Dataverse connector and choose the appropriate Dataverse table before adding the code to the Power Apps Label control. Otherwise, you might have certain issues.
Text = Concat(
LookUp(
'Patient Registrations',
'Patient Name' = "Gene Gorg"
).Reason,
Text(Value),
"; "
)
Where,
- Concat = Power Apps CONCAT function in Power Apps is used to concatenate two or more strings together. This function allows you to combine different pieces of text, or even data from multiple fields or columns, into a single string.
- LookUp = Power Apps LookUp function is used to search for a single record in a data source that matches specified criteria. This function can be used to retrieve data from a table or list based on a specific value in one or more fields.
- ‘Patient Registrations’ = Provide the Dataverse Table name.
- ‘Patient Name’ = Specify the Dataverse Column name of whom you want to display the choice values.
- “Gene Gorg” = Enter the Person or Patient name of whom you want to display the choices.
- Reason = Provide the Dataverse Choice Field name.
- Text(Value) = The Power Apps Text function transforms any data type into a text representation using a predefined format.
- “; “ = This is the separator that helps to separate the choice values inside the label control.
Once you applied the code in the label control, the result (specific Dataverse Choices) will appear as shown below.
This is how to get a specific Dataverse Choice Value using Power Apps Label Control.
Also, Read: Dataverse Primary Name Column Autonumber
Get a Dataverse Choice Value using Power Apps Combobox Control
Next comes to how to get a Dataverse Choice value using Power Apps Combobox control.
In Power Apps Screen, add a Combobox control (where you want to display the patient disease reason) and apply the code below on its DefaultSelectedItems property as:
NOTE:
When adding the code to the Power Apps Combobox control, make sure the Dataverse connector is connected and that the proper Dataverse table is selected. If not, you can experience certain problems.
DefaultSelectedItems = LookUp(
'Patient Registrations',
'Patient Name' = "Gene Gorg"
).Reason
Where,
- ‘Patient Registrations’ = Dataverse table name
- ‘Patient Name’ = Specify the Dataverse Column name of whom you want to display the choice values.
- “Gene Gorg” = Enter the Person or Patient name of whom you want to display the choices.
- Reason = Provide the Dataverse Choice Column name
You can see the output (specific Dataverse Options) after applying the code in the Combobox control below.
This is how to get a Dataverse Choice Value using Power Apps Combobox Control.
Check out: Filter Dataverse Choice Column [With Various Examples]
Get a Dataverse Choice Value using Power Apps Dropdown Control
Here, we will overlook how to get a Dataverse Choice Value using Power Apps Dropdown Control.
In this case, I would like to get the Dataverse choice values of Ronald Crust (3rd record from the above Dataverse table).
To work around this, We will apply the same above code (Get a Dataverse Choice Value using Power Apps Combobox Control) in the Dropdown control.
NOTE:
Ensure to connect the Dataverse connector and choose the appropriate Dataverse table before adding the code to the Power Apps Dropdown control. Otherwise, you might have certain issues.
Insert a Dropdown control and put the code below on its Items property as:
Items = LookUp(
'Patient Registrations',
'Patient Name' = "Ronald Crust"
).Reason
Where,
- ‘Patient Registrations’ = Provide Dataverse table name.
- ‘Patient Name’ = Specify the Dataverse Column name of whom you want to display the choice values.
- “Ronald Crust” = Enter the Person or Patient name of whom you want to display the choices.
- Reason = Provide the Dataverse Choice Column name.
Finally, Save, Publish, and Preview the app. Once you will expand the Dropdown control, you can see all the dataverse choice values of a specific item or person as below.
This is how to get a Dataverse Choice Value using Power Apps Dropdown Control.
Furthermore, you may like some more power apps tutorials:
- How to Patch Dataverse Choice Column in Power Apps
- Power Automate Dataverse Update Multiple Rows
- How to filter SharePoint choice field within Power Apps?
- HTML text control in Power Apps
- How to use Power Apps label control?
- How to display images within Power Apps from a SharePoint list?
In this Power Apps Dataverse tutorial, We discussed everything about Power Apps Get Value Of Choice Field Dataverse. Also, we covered the topics below:
- How to get a specific Dataverse choice value using Power Apps Label Control
- How to get a Dataverse choice value using Power Apps Combobox Control
- How to retrieve a Dataverse choice value using Power Apps Dropdown Control
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. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (9 times). I have also worked in companies like HP, TCS, KPIT, etc.