Hello All,
I am trying to find duplicates for sharepoint document locations and therefore I am builiding a fetchxml Query to find all duplicates.
The list is quite large (25k) and therefore i need to filter the result again anyways but just "List rows" would exceed the 5k limit.
The Query looks as such:
<fetch aggregate="true" top="200" >
<entity name="sharepointdocumentlocation" >
<filter type="and" >
<condition attribute="regardingobjectid" operator="not-null" />
</filter>
<attribute name="regardingobjectid" groupby="true" alias="groupId" />
<attribute name="regardingobjectid" aggregate="count" alias="count" />
<order alias="count" descending="true" />
</entity>
</fetch>
The Query results in 89a table with the desired results when using XRM-Toolbox.

But if i try to fetch via an http request in flow/logic app:

I get the following Error Response:
"code": "0x0","message": "An ODataPrimitiveValue was instantiated with a value of type 'Microsoft.Xrm.Sdk.EntityReference'. ODataPrimitiveValue can only wrap values which can be represented as primitive EDM types."
Does anybody have an idea how to fix this or how i can understand the error in this context.
The field I am grouping on is a lookup field where i use the id to group.
Thank you,
Felix