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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested Answer

API is not working...

(0) ShareShare
ReportReport
Posted on by 487

Hi All,

I am trying to run a simple query with the api, but it seems to only work on default fields, which is... 

api/data/v9.0/CUSTOMTABLE1/?$apply=groupby((RELATIONFIELDTOTABLE2/FIELD_FROM_TABLE2),aggregate(FIELD_FROM_TABLE_1 with sum as total))

based on this: 

opportunities?$apply=groupby((parentaccountid/name),aggregate(estimatedvalue with sum as total))

from here: https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/query-data-web-api

The thing is, it only works with original tables. With custom tables it says :

   "code""0x80041103",
        "message""'CUSTOMTABLE1' entity doesn't contain attribute with Name = 'RELATIONFIELDTOTABLE2' and NameMapping = 'Platform'. MetadataCacheDetails: ProviderType=Dynamic, StandardCache=True, IsLoadedInStagedContext = False, Timestamp=53221094, MinActiveRowVersion=53221094, MetadataInstanceId=44365775, LastUpdated=2021-04-18 08:52:58.400"

Any work around? Or raison why we are not allowed to use this on custom tables?

Regards

I have the same question (0)
  • Suggested answer
    Wahaj Rashid Profile Picture
    11,321 on at

    Hi,

    Thank you for your query.

    Aggregates are not limited to out-of-the-box tables.

    Please make sure relationship and fields name are correct.

    If you are not sure what is the name of the field/property, Get a record using Web API and see the names.

    You can also download the OData metadata for more details:

    How to download metadata file From CRM? - Microsoft Dynamics CRM Community

  • Hedi Daneels Profile Picture
    487 on at

    Hi,

    I used the metadata to build my query, and that is also why we get this specific message, he sees the mapping. He just doesnt want to use it.

    Regards

  • Hedi Daneels Profile Picture
    487 on at

    Quick question that will help me a TON

    Why does this work:

    api/data/v9.0/opportunities?$apply=groupby((parentaccountid/name))

    But not this:

    api/data/v9.0/contacts?$apply=groupby((parentcustomerid_account/name))

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
ManoVerse Profile Picture

ManoVerse 55 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans