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 :
Any work around? Or raison why we are not allowed to use this on custom tables?
Regards
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))
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
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
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 290,522 Super User 2024 Season 2
Martin Dráb 228,441 Most Valuable Professional
nmaenpaa 101,148