Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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