Forum Discussion
Help using SQl to limit the data being pulled form Microsoft Dynamics by Odata
Took this step out and works but extremely slow and in fact crashed
Hi mike_asplin ,
Could you please try the troubleshooting steps mentioned below and let us know how it goes? We’ll be happy to assist you further
-
Refresh the page
-
Open it in a new tab or window
-
Restart your browser
-
Clear your cache and cookies
-
Disable extensions temporarily
-
Try accessing the site from another browser (like Chrome or Firefox)
Best Regards,
Lakshmi.
- mike_asplin11 months ago
Helper V
Sorry i dont understand I'm in power BI desktop?
using this query
let Url = "https://chaxxxxx.api.crm11.dynamics.com/api/data/v9.1/", SelectColumns = "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(Dateparameter, "yyyy-MM-ddTHH:mm:ssZ"), FilterQuery = "$filter=starttime ge " & FilterDateText, ODataQueryOptions = [ Query = "$select=" & SelectColumns & "&$" & FilterQuery ], Source = OData.Feed(Url, null, [Implementation="2.0"]), bookableresourcebookings_table = Source{[Name="bookableresourcebookings", Signature="table"]}[Data], Data = OData.Feed(bookableresourcebookings_table, null, ODataQueryOptions) in Datawith the extra T removed I Get this error. If i remove the Data = line i get a table but it includes everythnig so this Data = line is obviously critical.
- v-lgarikapat11 months ago
Community Support
Hi mike_asplin , apologies for the late reply.
Could you please try the workaround suggested below?
You don’t need to call OData.Feed twice. The first call already pulls the full dataset. Instead, you should apply filtering directly in the initial OData.Feed call using the query options.
let
Url = "https://chaxxxxx.api.crm11.dynamics.com/api/data/v9.1/bookableresourcebookings",
SelectColumns = "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(Dateparameter, "yyyy-MM-ddTHH:mm:ssZ"),
FilterQuery = "$filter=starttime ge " & FilterDateText,
QueryOptions = "$select=" & SelectColumns & "&" & FilterQuery,
Source = OData.Feed(Url & "?" & QueryOptions, null, [Implementation="2.0"])
in
SourceBest Regards,
Lakshmi.
- v-lgarikapat11 months ago
Community Support
Hi mike_asplin ,
We haven’t heard back from you regarding our last response, so I just wanted to check in to see if you were able to resolve the issue. If you have any further questions or need assistance, please feel free to let us know.
We appreciate your engagement and thank you for being an active part of the community.
Best Regards,
Lakshmi