Quantcast
Channel: Developer topics
Viewing all articles
Browse latest Browse all 17899

Custom connector for proprietary file type

$
0
0

We'd like Power BI Desktop to understand a custom file format and for users to be able to select a file of that type and have Power BI Desktop open it (generating probably multiple tables). Were I'm currently at with this is trying to create a custom connector for this and coming up against a number of issues. So a general question - is a custom connector the right way to go, or is there some other way to open a particular file type and have Power BI apply some Power/M query to extract the relevant data (bearing in mind the ideal is for the user to be able to select a file and have the data appear without delving into any data manipulation themselves)?

 

One of the issues I'm getting is with credentials - relevant section of code below. Accessing a test file using Visual Studio to debug (e.g. PQExtension1.Contents("\\path\to\test\file")) requests credentials when first running for Data Source Kind PQExtension1 (I select 'Windows' and Set Credential), but then requests credentials again when running subsequently, this time for Data Source Kind File. How to reuse the credentials previously entered?

section PQExtension1;

[DataSource.Kind="PQExtension1", Publish="PQExtension1.Publish"]
shared PQExtension1.Contents = (path as text) =>
    let
        Source = Xml.Tables(File.Contents(path)),
        pkg = Source{0}[pkg],
        pkgNav = GetLevelAsTable(pkg) //not getting as far as this
    in
        pkgNav;

PQExtension1 = [
    Authentication = [
        Windows = []
    ],
    Label = Extension.LoadString("DataSourceLabel")
];
...

So - is there a better way than custom connector and if not, can I reuse those credentials?

 

Many thanks

 

Craig


Viewing all articles
Browse latest Browse all 17899

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>