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

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,526)