Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi
I am using the following project template to provide native query support to my Power Bi custom connector.
In the source code SqlODBC.Contents contains three parameters for server, database and options(For native query).
[DataSource.Kind="SqlODBC", Publish="SqlODBC.Publish"]
shared SqlODBC.Contents = ( server as text, optional database as text, optional options as record ) =>
When I select my connector using "Get Data" and click the connector, a screen appears with there text boxes.
Text box 1 - Server address
Text box 2 - Database name
Text Area - For entering native query like select * from some table.
But in my case I would like to get database information from an authenticated API. So I don’t need the Server Address and Database name text boxes any more. I removed the parameters "server as text" and "optional database as text" from SqlODBC.Contents parameters
Now it looks like below and new screen does not have text boxes for server and database (Only Native query text area is present)
[DataSource.Kind="SqlODBC", Publish="SqlODBC.Publish"]
shared SqlODBC.Contents = ( options as record ) =>
And for the testing purpose I hardcoded the servername and database name in my code as given below. (Instead of getting it from text boxes)
[DataSource.Kind="SqlODBC", Publish="SqlODBC.Publish"]
shared SqlODBC.Contents = ( options as record ) =>
let
server = "my azure sql server address",
database = "my database name",
and the Screen looks like
BUT NOW I AM GETTING THE FOLLOWING ERROR MESSAGE FROM SOME WHERE IN THE LIBRARY
----------------------------------------------------------------------------------------------------------------------------------------
[Expression.Error] The parameter "database" doesn’t exist in the current context. Please check the connector native query implementation.
----------------------------------------------------------------------------------------------------------------------------------------
If I add the Database parameter back into the parameter list and get the database name from text box, then native query is working fine
Please provide me a feasible solution as my customer doesn't want to enter server address and database name.
Thanks and regards
Anishkumar.M
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
12 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
8 | |
7 | |
6 |