Do you know how to display Dataverse Choices in Power Apps Gallery Control? Well, in this Microsoft Dataverse tutorial, We will discuss how we can display the Dataverse Choice values (multi-select option set) in a Power Apps Gallery Control.
Also, we will see how to add a Power Apps sub-gallery control inside a main gallery control and display all the Dataverse choices.
Read: Power Apps Get Value Of Choice Field Dataverse
Display Dataverse Choices (multi-select option set) in Power Apps Gallery Control
Here we will see how we can display Dataverse Choices (with a multi-select option set) in a Power Apps Gallery Control.
Scenario:
I have a Dataverse Table named Patient Registrations. This table has a Choice column called Reason (with the multi-select option set). Now I would like to display all the Dataverse choice values in the Power Apps Gallery Control.
The image below represents the Power Apps Vertical Gallery control with all the Dataverse records. In the gallery, you can see the last section (Reason) is having a Label control with the code below: (On Label’s Text property)
Text = ThisItem.Reason
Where
Reason = Dataverse Choice Column Name
But when I use this above code on the Label’s Text property, I am getting the below error i.e.
This formula uses scope, which is not presently supported for evaluation.
Refer to the screenshot below.
Follow the steps below that how we can achieve our needs.
Solution:
Step – 1:
First, select your Power Apps Gallery control (Master Gallery) and delete the label control that shows the above error.
Step – 2:
Here we will add a Sub-gallery inside the Master Gallery. Select the first section of the master gallery -> Expand + Insert -> Select Vertical gallery as shown below.
Step – 3:
Drag the child gallery and keep it under the Reason field. The below screenshot represents how the sub-gallery control will look inside the master gallery control. Just rename the sub-gallery control to Child Gallery.
Step – 4:
Select the Child Gallery -> Go to the Properties tab (from the right side) -> Expand the Layout option and select Title as below.
Step – 5:
Next, select the Child gallery control and set its Items property to the code below:
Items = ThisItem.Reason
Where,
Reason = Dataverse Choice Field Name
After applying the above code, you will see the same error message i.e. “This formula uses scope, which is not presently supported for evaluation“.
Step – 6:
To overcome the above issue, select the Title control inside the Child gallery and set its Text property to the code below:
Text = ThisItem.Value
Once you applied the above code, you will not see any error message and at the same time, you will get the appropriate choices for each individual record.
Step – 7:
Finally, you can remove or delete the Separator and Next arrow icons from the Child gallery. You can easily delete these two controls by using the Del button in your system. Or you can delete them by using the Delete option (Select the control -> Click … -> Delete) (from the left navigation).
Additionally, if you want to give these controls to any other design, you can do so by using properties like Color, Font, Font size, etc.
Once everything is done, then the Gallery control will display all the Dataverse choices (multi-option set) like the image below.
This is how to display Dataverse Choices in Power Apps Gallery Control.
Furthermore, you may like some more Power Apps and Dataverse tutorials:
- How to Patch Dataverse Choice Column in Power Apps
- Power Automate Dataverse Update Multiple Rows
- How to Patch Dataverse Number Field in Power Apps
- Filter Dataverse Choice Column [With Various Examples]
- How to Create Dataverse File Field
- How To Get Dataverse List Rows Count Using Power Automate
- How To Remove Commas From Dataverse Number Field
- HTML text control in Power Apps
In this Microsoft Dataverse tutorial, We discussed how we can display the Dataverse Choice values (multi-select option set) in a Power Apps Gallery Control.
Also, we saw how to insert a Power Apps sub-gallery control inside a main gallery control and display all the Dataverse choices.
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.