How to Display Dataverse Choices in Power Apps Gallery

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.

Display Dataverse Choices in Power Apps Gallery Control
Display Dataverse Choices in 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.

How to Display Dataverse Choices in Power Apps Gallery
How to Display Dataverse Choices in Power Apps Gallery

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.

How to display Dataverse Choices in Power Apps Gallery Control
How to display Dataverse Choices in Power Apps Gallery Control

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.

Get Dataverse Choices in Power Apps Gallery
Get Dataverse Choices in Power Apps Gallery

Step – 3:

See also  How to Convert String to GUID in Power Automate?

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.

How to get Dataverse Choice options in Power Apps Gallery
How to get Dataverse Choice options in Power Apps 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.

How to retrieve Dataverse Choices in Power Apps Gallery
How to retrieve Dataverse Choices in Power Apps Gallery

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

Retrieve Dataverse Choices in Power Apps Gallery
Retrieve Dataverse Choices in Power Apps Gallery

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.

How to get Dataverse Choice values in Power Apps Gallery Control
How to get Dataverse Choice values in Power Apps Gallery Control

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.

Get Dataverse Choice values in Power Apps Gallery
Get Dataverse Choice values in Power Apps Gallery

Once everything is done, then the Gallery control will display all the Dataverse choices (multi-option set) like the image below.

How to get Dataverse Choices in PowerApps Gallery
How to get Dataverse Choices in PowerApps Gallery

This is how to display Dataverse Choices in Power Apps Gallery Control.

See also  How to check if an array contains value using Power Automate?

Furthermore, you may like some more Power Apps and Dataverse tutorials:

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.

>