Forum Discussion
mike_asplin
4 months agoHelper V
Bit of help to identifying a dynamic data source
Hi. I have a modle that pulls some of its data form Microsoft Dynmics. Some very helpful people guided me how to create a url that pulled in specific column and dates rather than pulling whole thing ...
- 4 months ago
Hey, mike_asplin ,
basically in your case, you can jsut do this:
let BaseUrl = "https://chxxxxd.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 ] )), Data = Source[value] in DataThe most important part, and what causes the Dynamic Source flag, is the splitting the host and relative path:
BaseUrl = "https://chxxxxd.api.crm11.dynamics.com",
Endpoint = "api/data/v9.1/bookableresourcebookings",
lbendlin
4 months agoSuper User
Where does #"Load Date" come from?
- mike_asplin4 months agoHelper V
Its a parameter
- lbendlin4 months agoSuper User
That sounds odd. In any case - try with a hard coded date first.
You may want to watch this video too... https://www.youtube.com/watch?v=RbqCA6srkmM