Forum Discussion
mike_asplin
4 months agoHelper V
OData source error
Hi I have amodle that did have some OData sources, but i changed them all to CDS sources. So now i just have CDS, shareoint excle files and a public website. Even so when I try to refresh in serv...
- 3 months ago
all good
mike_asplin
4 months agoHelper V
Ok understood. so can you just confrim this query is an OData query?
let
BaseUrl = "https://chaxxxx.api.crm11.dynamics.com",
Endpoint = "api/data/v9.1/bookableresourcebookings",
SelectColumns = "bookableresourcebookingid,_bookingstatus_value,_resource_value,name,_cha_clientid_value,_owningteam_value,duration,starttime,_cha_carercontactid_value,_msdyn_workorder_value,msdyn_totalcost,endtime,statuscode,msdyn_milestraveled,msdyn_actualarrivaltime",
FilterDateText = DateTime.ToText(#"Load Date", "yyyy-MM-ddTHH:mm:ssZ"),
QueryRecord = [
#"$select" = SelectColumns,
#"$filter" = "starttime ge " & FilterDateText
],
Source = Json.Document(Web.Contents(
BaseUrl,
[
RelativePath = Endpoint,
Query = QueryRecord
]
)),v-aatheeque
3 months agoCommunity Support
Hi mike_asplin
The query you are using is indeed an OData query because the Dynamics 365 / Dataverse API exposes data via the OData v9.1 endpoint. Even though you are calling it with Web.Contents the $select and $filter options are OData system query options.
Microsoft recommends using the Dataverse connector in Power BI Desktop instead of manually calling the OData feed. The connector handles authentication and schema more reliably and avoids errors like DMTS_OAuthFailedToGetResourceIdError.
Hope this helps!!
Thank You.