Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Sales forum / Getting Error in Aggre...
Sales forum
Suggested answer

Getting Error in Aggregate fetch in MS flow

Posted on by 359

Hi,

I have a Ms flow, In which I am using an aggregate fetch but It's giving the error

"The provided query options are not valid: System.ArgumentException: 'select' and 'expand' cannot be both null or empty. at System.Web.OData.Query.SelectExpandQueryOption..ctor(String select, String expand, ODataQueryContext context, ODataQueryOptionParser queryOptionParser)at Microsoft.Crm.Extensibility.OData.EdmUtilities.PopulateSelectExpandClauseForQueryOptions(String selectClause, CustomQueryOptions queryOptions, String expandClause)"

As, I have checked the same fetch through 'FetchXMLTester', there it's giving the right result without any error.

 fetch: 

<fetch version="1.0" output-format="xml-platform" mapping="logical" distinct="false" aggregate="true">
<entity name="acl_eventparticipant">
<filter type="and">
<condition attribute="acl_eventlookupid" operator="eq" value="@{triggerBody()?['id']}" />
<condition attribute="acl_invitestatus" operator="eq" value="123456" />
</filter>
<link-entity name="contact" from="contactid" to="acl_contact" visible="false" link-type="outer" alias="contact" >
<attribute name="acl_company1" alias="Organization" groupby="true" />
</link-entity>
</entity>
</fetch>

Categories:
  • Himanshu Kamboj Profile Picture
    Himanshu Kamboj 359 on at
    RE: Getting Error in Aggregate fetch in MS flow

    Hi Zhang,

    As you know, I am using here the aggregate fetch, and I can not use any attribute which is not holding any aggregate property(sum, avg, count, groupby).

     

    Thanks!!

  • Suggested answer
    Sayen Zhang Profile Picture
    Sayen Zhang on at
    RE: Getting Error in Aggregate fetch in MS flow

    Hi Himanshu,

    According to your error message, you can set at least one attribute from entity which is not null like:

    <attribute name=''acl_eventparticipantid'' />

    Best Regards,

    Sayen Zhang

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,252 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,089 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans