Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Getting Error in Aggregate fetch in MS flow

Posted on by 379

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>

  • Himanshu Kamboj Profile Picture
    Himanshu Kamboj 379 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

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans