Best way to Connect Power BI with Kinetic Public cloud

Hi,
Has anyone could connect the Power Bi to Kinetic on cloud?
on previous versions (I mean ERP 10 and 9) I was using data gateway directly to Ms SQL and SQL queries could pull all the information I required, seamlessly it was getting updated with the schedules i configured in Data Gateway.

Now we are on Kinetic Public Cloud and I have to use the Rest API and found the whole connections works with API keys through IDP. With some help documents I could managed to get data on version API v1 only with from BO services using power query. I am passing Client ID, Client secret and client URL generated from IDP. I am getting data for Erp.BO.PartSvc, Parts list etc. But I was looking for BAQ services and couldnt succeed.
With API help page and Odata feed and result was same.
Is there any other way or does any have the correct syntax,steps which connect the BAQ (with/without) parameters.

Power Query

let
    idp_base_url="https://login.epicor.com",
    client_id = "3c3b414d-clientid",
    client_secret="4m8gQO+10mbsjw-client_secret",
    erp_api_base_url="https://uksouthdtpilot02.epicorsaas.com/SaaSPilot",
    /*erp_odata_get_url_part = "/api/v2/odata/companyID/BaqSvc/ADP_IT_CUS/Data",*/
    erp_odata_get_url_part = "/api/v1/Erp.BO.PartSvc/List",  
    /* MultiPart Post code from: https://gist.github.com/CurtHagenlocher/b21ce9cddf54e3807317 */
    Web.MultiPartPost = (url as text, parts as record) as binary =>
        let
           unique = Text.NewGuid(),
           boundary = "--" & unique,
           crlf = "#(cr)#(lf)",
           item = (name, value) =>
             let
               filename = Value.Metadata(value)[name]?,
               contentType = Value.Metadata(value)[type]?,
               line1 = "Content-Disposition: form-data; name=""" & name & """" &
                (if filename = null then "" else "; filename=""" & filename & """"),
               line2 = if contentType = null then {} else { "Content-Type: " & contentType },
               lines = { boundary, line1 } & line2 & { "", value }
                in
                    Text.Combine(lines, crlf) & crlf,
            body = Text.Combine(List.Transform(Record.FieldNames(parts), each item(_, Record.Field(parts, _)))) & boundary & "--" & crlf
        in
            Web.Contents(url, [
                Headers=[#"Content-Type"="multipart/form-data; boundary=" & unique],
                Content=Text.ToBinary(body)
            ]),
    parts = [
        grant_type = "client_credentials",
        scope = "epicor_erp",
        client_id = client_id,
        client_secret = client_secret
    ],
    result = Json.Document(Web.MultiPartPost(idp_base_url & "/connect/token", parts)),
    resultToken= result[access_token],
    erpResult = Json.Document(Web.Contents(erp_api_base_url,
    [
        Headers=[#"Authorization"="Bearer " & resultToken],
        RelativePath = erp_odata_get_url_part
    ]))[value],
    tabularValue = Table.FromList(erpResult, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(tabularValue, "Column1", {"Company", "PartNum", "PartDescription", "ClassID", "TypeCode"}, {"Column1.Company", "Column1.PartNum", "Column1.PartDescription", "Column1.ClassID", "Column1.TypeCode"})
in
    #"Expanded Column1"

We are interested in this as well. Did you ever figure it out?

We are currently looking into this too! Would love to hear how you were able to get this set up.

Epicor offers a read-only replication database for reporting against. This may assist in getting the most similar functionality. Otherwise, you get stuck with APIs against the environment.

Grow offers BAQ/SQL integration easily with cloud, if you aren’t already invested into PowerBI/Fabric.

We started out utilizing BAQs thru REST API for our connection. It works on a smaller scale data pulls. We have since moved to getting the Replication DB from Epicor and now have a gateway connected to get this in our PowerBI. We have found this to be a much better solution and we are not taxing our prod DB with large data calls. The replication happens every 3-5 seconds so the data is current. We saw significant reduction in our PowerBI refresh times with this.

1 Like

Hi
I create BAQs that contain the “raw data” that I need in Power BI etc. I call these using an OData connection (as per the API help for v1):

Once the “raw data” is in the Data Model, I use the standard Power BI tools (i.e. DAX/Widgets) to create the calculations/visualizations that are needed.

The connection method for REST v2 is similar, however you need to have created and pass in the appropriate API key that you have setup through the front end of Epicor:

1 Like