Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to add additional functions users can use through the PQ Advanced editor on top of the published function for my connector. I have used this technique in other connectors but having trouble with getting the Connector to build when the published function has optional or no inputs. Here is the error message I get when building in VSCode with MakePQX:
Failed to display extension info due to [DataFormat.Error] We were unable to infer data source path information from the set of functions associated with the data source kind 'HelloWorld'., failed to execute c:\Users\fieldsj\.vscode\extensions\powerquery.vscode-powerquery-sdk-0.2.2-win32-x64\.nuget\Microsoft.PowerQuery.SdkTools.2.114.4\tools\PQTest.exe info --extension "d:\Source\Repos\PQ-HelloWorld\bin\AnyCPU\Debug\PQ-HelloWorld.mez" --prettyPrint
Here is a snip of the code I mocked up in a simple HelloWorld that triggers the same error:
[DataSource.Kind="HelloWorld", Publish="HelloWorld.Publish"]
shared HelloWorld.Contents = (optional message as text) =>
let
_message = if (message <> null) then message else "(no message)",
a = "Hello from HelloWorld: " & _message
in
a;
[DataSource.Kind="HelloWorld"]
shared HelloWorld.Message = (message as text) =>
let
a = "Hello from HelloWorld: " & message
in
a;
I only added the .Message function to a fresh project. If I remove "optional" on the .Contents input, it builds just fine. Without the .Message function, it builds fine even with the optional input on .Contents but as soon as you introduce another DataSource.Kind with a required input, the error gets thrown. Is there any way to have an optional input or no input for the published function but also have the additional functions that do require inputs?
Hi @JoeFields ,
The error message suggests that there is an issue with inferring data source path information from the set of functions associated with the data source kind 'HelloWorld'. Based on the code snippet you provided, it looks like you are trying to add additional functions to your connector that have required inputs, but your published function has an optional input or no input. This may be causing the error.
One possible solution could be to modify your published function to have a required input, even if it is just a dummy input that is not used in the function. This should allow you to build your connector with the additional functions that have required inputs.
Another solution could be to create a separate data source kind for the additional functions that have required inputs, rather than trying to add them to the same data source kind as your published function. This may help avoid conflicts with the optional or no input in your published function. I hope this helps! Let me know if you have any further questions.
excel - Power query function optional arguments - Stack Overflow
Best Regards
User | Count |
---|---|
5 | |
5 | |
3 | |
2 | |
2 |
User | Count |
---|---|
9 | |
7 | |
5 | |
4 | |
4 |