Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Configuration file for custom connector

Hello,

 

I'm trying to access configuration file within my powerBI custom connector.

I would like to add the configuration file as parameter to the custom connector, as it should handle many url endpoints with corresponding apikeys. Custom connector should merge the data from all endpoints to show them just in one table, so manual import and merging would require much manual work.

 

Is there any way to make file selection as parametr for the custom connector?

 

I tried to use filepath as string parameter and than use File.Contents(filepath), but connector had some problem with credentials. Probably it can't access the file location or so.

Currently I tried "Authentication = [Windows = []]" and also the "Authentication = [Implicit= []]", but none of these solved the problem.

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Yes you can

    put a config file in same directory and use "Extension.Contents" 

     

     


    config = Json.Document( Extension.Contents( "Config.json") );
    shared property= config[property];

    • Anonymous's avatar
      Anonymous
      Not applicable

      But this has to be done before compilation of the connector.

      I need to let this choice on the user of the connector, therefore I need to specify the file/parameters after the "Get Data" in PowerBI

  • Has anyone found a solution to this? It has to be a config file that is separate from the compiled package (similar to an app.config so that a user can change settings)

    e.g.