I am trying to get data from CRM via the REST API. I am able to authenticate and retrieve data from CRM, but the data I receive looks different from the same data collected in Power BI.
I am trying to retrieve data from oppertunityproducts. When running the query in Power BI I get this:
But when running the query in cURL I only get these attributes:
I am missing the interesting ones with the reference data.
When running fiddler I can see, that Power BI does some batch lookups, when the tables and lists are expanded.
Is there an easy way to get the exact same query that Power BI makes running via cURL?
Awesome! If helps you to resolve this, please mark the thread as answered.
regards,
I will definitely give that a try. Thanks!
So,
In that case you can create a view inside of CRM to retrieve the data needed. Then download the fetchxml for that view and then you can use the fetchXML api query: docs.microsoft.com/.../retrieve-and-execute-predefined-queries
I have actually been looking into expand, but got stuck on how to direct the lookup to the correct table. I can only find documentation on valued navigation.
FetchXML seems to be a way to define a schema for the query I need to build, but like with expand it seems a little blurry how to get the data from all the sources I need.
So,
You will need to create your own webapi query as needed, to retrieve related records you could use expand:
docs.microsoft.com/.../query-data-web-api
Also, there are some 3rd party apps such community.dynamics.com/.../crm-rest-builder-v2-6-0-0
All the ones that contains Record or Table in the image. Tables like: ca_opportunityproduct_ca_forecastline_OpportunityProductId, ca_opportunityproduct_ca_invoiceline_OpportunityProductId and ca_ProductGroupId.
The thing is, that it works in Power BI, but I would like the API call to return the same data in a REST API call without using Power BI. I need the data for further automation elsewhere.
Hello there,
what kind of fields are you missing?
have you tried use this docs.microsoft.com/.../use-power-bi
regards,
Daivat Vartak (v-9d...
225
Super User 2025 Season 1
Muhammad Shahzad Sh...
106
Most Valuable Professional
Eugen Podkorytov
102