cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
morall
Microsoft
Microsoft

Sorting a gallery by a choice data type

Sort(Filter('Source', Candidate.'ID'=Gallery1.Selected.'ID'), InterviewStatus, Descending)

 

InterviewStatus is a Choice data type in a Common Data Source.

 

I am getting this error: Cannot sort on expression type.

 

Is there a way to sort a gallery based on a Choice selection?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@morall 

Sorry, I missed that you are using Dataverse. This is a known issue that you cannot sort optionsets. (at least as far as I know)

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

5 REPLIES 5
RandyHayes
Super User III
Super User III

@morall 

Please consider changing your Formula to the following:

 

Sort(
    AddColumns(
        Filter('Source', Candidate.'ID'=Gallery1.Selected.'ID'), 
        "_interviewStatus", InterviewStatus.Value
    ),
    _interviewStatus,
    Descending
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

When I try InterviewStatus, it doesn't give me the ".Value"
When I try:

Sort(
AddColumns(
Filter(
Source',Candidate.'ID' = Gallery1.Selected.'ID'
),
"displayOrder", 'Created On'
),
"displayOrder",
Descending
)

 

Its not changing the order even though no errors are showing

RandyHayes
Super User III
Super User III

@morall 

Sorry, I missed that you are using Dataverse. This is a known issue that you cannot sort optionsets. (at least as far as I know)

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

does Dataverse mean common data source? 

RandyHayes
Super User III
Super User III

@morall 

Yes, it was renamed several months ago.

 

Here is an Idea in the Idea forum that refers to sorting option sets.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,265)