Forum Discussion

Torben Kirk Wolf's avatar
Torben Kirk Wolf
Brass Contributor
Jul 06, 2021
Solved

Relinking Transform Sample File query with function in Power Query?

Hi all,   When transforming a sample file, e.g. as part of a Folder query, it really is neat that Power Query automatically creates a sample file parameter and especially a custom function that aut...
  • E_Lancaster's avatar
    Jun 09, 2022

    Torben Kirk Wolf 

    Hi,

    I was just trying to resolve the same problem and came across your post.  I found a way to do it- Sort of...  It's a little clunky but works.  This was the only way I could determine to "relink" after searching forever online with no resolution so I figured I would pass it along.

    1. Open the "Transform Sample File" in the query editor.
    2. Once the editor opens right-click on "Transform Sample File" under the queries pane on the left. 
    3. In the pop-up menu click "Create Function".  You will have to name it something different than what it was previously.  Save. 
    4. Edit your main queries to replace the function reference(s) with the new function name.
    5. Optional Clean-up.  A new sub-folder is created by step 3.  If you want everything back to one folder just move the items in the new sub-folder into the original sub-folder and delete the new sub-folder once it's empty. Also delete the old disconnected function.      

Resources