microsoft / microsoft/vscode-powerquery-sdk
Examples Of Functions in Navigation Tables
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 92
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
Preflight Checklist
- I have installed the latest version of Power Query SDK.
- I have checked existing resources, including the common issues and the release notes.
- I have searched for similar issues.
Problem
I'm struggling to write a function in a Custom Connector that is available via Navigation Tables that allows parameters to be sent but also uses information from the navigation table itself (ie. the URL).
For example, let's say I've got the following Navigation Table hierarchy....
Server 1
APIs
Alpha
Beta
Server 2
APIs
Alpha
Beta
These are dynamically created, so internally they call call the same M function (ie. MyConnector.CallAPI). I need to be able to tell the difference between the 'Beta' function on Server 1 vs the 'Beta' function on Server 2, while still allowing parameters to be set by the end-user.
When using Table.ToNavigationTable, I know I can set 'data' to...
function_name(url) to specifically call the function with a given url, or
function_name to allow the system to read parameter metadata so it can provide a UI.
Is there a mechanism available to do both - have a single parameter passed from navigation, and the rest of the parameters supplied by the user.
Desired Solution
I'd like to be able to have a Custom Connector function work with both navigation-supplied and user-supplied parameters.
For example, a named property in the called function that always contains the full navigation URL. So if I had the following...
MyConnector.APIFunction = (userparam as text, navigationurl as text)...
userparam would be a parameter set in the UI, while
navigationurl would be the endpoint URL chosen from the navigation.
Alternatives and Workarounds
I've tried some techniques (various ways of passing the function in Table.ToNavigationTable), but I'm not familiar enough with M and its quirks to figure it out.
Additional Context
No response
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing Table.ToNavigationTable and the custom connector function signature described in the issue. Determine whether a navigation-supplied URL and user-supplied parameters can coexist; done means an explicit working example or documentation explaining the supported pattern and limitations.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100