web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

Orderby on aggregate query (alias required)

(0) ShareShare
ReportReport
Posted on by 25

Hi there,

I am trying to apply an orderby to an aggregate query and am getting the following error message back:

{"error":{"code":"0x80041134","message":"An alias is required for an order clause for an aggregate Query."}}

I understand what the error message is saying but am unclear on how to actually resolve the issue. Here is an example of the query:

.../incidents?$filter=statecode eq 0&$groupby((statuscode), aggregate($count as total))&$orderby=statuscode desc

Regards,
Andy

I have the same question (0)
  • Suggested answer
    Modesto Iacopino Profile Picture
    Microsoft Employee on at

    Hello Andy,

    please have a look in the following:

    Query Data using the Web API (Microsoft Dataverse) - Power Apps | Microsoft Docs

    There are a lot of example that can help you to build your query correctly.

    Thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
11manish Profile Picture

11manish 107 Super User 2026 Season 2

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 64 Most Valuable Professional

#3
ParthPatel249 Profile Picture

ParthPatel249 62

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans