Forum Discussion
Using the Dynamics Business Central Connector, how can I add date filters?
- 4 years ago
I figured it out.
The Business Central connector using the Power BI Odata connector, and the authorizaton is built in.
So the doucumentation I was looking for is the in the Odata connector.
The Odata Connector is well designed and folds and filters back to the Odata source.
So the solution to my problem was dead simple, just add a filter to the query and you get the period you want.
Here's a sample of the M code.
It was all created using the GUI, no advaced editor required.
Chose the income statements table, then add a date filter with the date you want the data for.
let
Source = Dynamics365BusinessCentral.ApiContents(null, null, null),
PRODUCTION = Source{[Name="PRODUCTION"]}[Data],
#"DC Hospitality Apex LLC" = PRODUCTION{[Name="Test Company 1"]}[Data],
v2.0 = #" Test Company 1"{[Name="v2.0"]}[Data],
incomeStatements_table = v2.0{[Name="incomeStatements",Signature="table"]}[Data],
#"Filtered Rows" = Table.SelectRows(incomeStatements_table, each [dateFilter] = #date(2022, 1, 31))
in
#"Filtered Rows"
Thanks.
I already have this working with the V1.0 API.
It seems that the new connector performs much better.
And I'd like to use it.
But I can't find any documentation on it whatsover. It supplies access to the 2.0 API, but filters are a critical part of using it becuase most quesries require a specific date range so you can look at a results at the end of an accounting period.
If someone could point to documentation on the syntax of
new Dynamics365BusinessCentral.Api()
that would really help.
Hi, dmacdonald
Here are some resources related to the API:
Welcome to the API(v1.0) for Business Central
Welcome to the API(v2.0) for Business Central
Getting Started Developing Connect Apps for Dynamics 365 Business Central
Welcome to the API(Beta) for Dynamics 365 Business Central
Enabling the APIs for Dynamics 365 Business Central
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- dmacdonald4 years ago
Advocate I
Thanks.
I'm using the API already. But I did some testing using the newly released PowerBI connector.
And that seems to peform much faster. I'm pulling data from over 40 companies, so it takes a while using the API.
But it's useless without the ability to filter by accounting periods.
And there is no documentation for it so it might already do that.
I'm just going to give up for now. Hopefully MS will provide some documentation in the future and it will be useful for financial reporting when that happens.
- AboodAlhamwi3 years agoNew Member