Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

How can I custom UI from connector code

Hello all,

 

I'm developing a custom connector and it works good.

The function Contents() takes 3 parameters: Environment (required), DateFrom (optional) and DateTo (optional):

Then the function shows the Navigator window that helps user to find and select a dataset:

 

What I want to change is behavoir of Power BI Desktop UI.

I want to place the optional parameters on the Navigator window, something like this:

How can I do that?

Is it possible?

 

Thanks in advance,

Alex.

  • artemus's avatar
    artemus
    6 years ago

    You should be able to refer to it if it is in scope. Just use a function which returns a function.

     

     

    DataFunction = (id as number) as function => (start, end) => // Use the id, start and end parameters

     

     

    And before you ask adding documentation to the function there is a bit buggy. Also if all parameters are optional, it will load the data automatically and then let the user modify them.

5 Replies

  • Smauro's avatar
    Smauro
    Solution Sage
    Hi Anonymous,

    I don't believe you can do that. Since you've already called Table.ToNavigationTable, the data displaying there is already passed data through the connector, taking into account the user's parameter inputs if configured correctly.

    The Navigation UI just reads what Table.ToNavigationTable returns and displays it in a pretty format. What you're asking is for this UI to be able to know how it got the values it got. Not really possible since we do not have access to the UI itself, nor can we change what Table.ToNavigationTable returns.

    Best,
    Spyros
    • Anonymous's avatar
      Anonymous
      Not applicable

      Finally, I was able to force PowerBI showing the parameters after selecting a datasource item.

      The discussion which helped me is here

      Now I can see the following:

       

      What is not good is I have to pass Id of dataset as well.
      Is there a way to pass that parameter to the function from connector code but leave others for user's entering?

      • artemus's avatar
        artemus
        Microsoft Employee

        You should be able to refer to it if it is in scope. Just use a function which returns a function.

         

         

        DataFunction = (id as number) as function => (start, end) => // Use the id, start and end parameters

         

         

        And before you ask adding documentation to the function there is a bit buggy. Also if all parameters are optional, it will load the data automatically and then let the user modify them.

  • dax's avatar
    dax
    Community Support

    Hi Anonymous , 

    I am not professional in UI code of custome connector, so I suggest you could @ super users in this forum or open a ticket for this problem(support ).

    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.