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

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

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

Power Apps Community Call

Monthly Power Apps Community Call

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

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (43,629)