cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

5 REPLIES 5
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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

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

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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

does Dataverse mean common data source? 

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. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (35,441)