Why is Orderby not working?

asked 2022-06-08T13:06:29.927+00:00
Ivan Marino 1 Reputation point

I already post this three months ago, but still no resposnse

Citing the Graph API Beta Documentation, it is said that for the timecards list is possible to add an orderby query parameter

Optional query parameters
This method supports the $filter, $orderBy, $top, $skipToken OData query parameters to help customize the response. For general information, see OData query parameters.


Unfortunately, if you try to do so you recieve the following error:

Query option 'OrderBy' is not allowed. To allow it, set the 'AllowedQueryOptions' property on EnableQueryAttribute or QueryValidationSettings.

Is it possible to know how to fix it?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
23,711 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. answered 2022-07-27T18:30:06.353+00:00
    AtulThorat-MSFT 386 Reputation points

    Hi @Ivan Marino ,

    Hope you are doing well.

    I tried to replicate timecard-list graph API endpoint as shown below.


    I have verified and replicated this scenario and got error message "Query option OrderBy is not allowed." Other OData query parameter such as $filter, $top, $skipToken are working as expected.

    So this seems to be documentation issue and we will share this information with Gtihub documentation team to review this.

    Hope this helps.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    No comments