Power Query: Prompt to select file on query update

Christoph Kümmeke
Christoph Kümmeke used Ask the Experts™
on
Hi,

I have a powerquery import having a specific file as source.

When updating this query, is there a feature to have the query ask to select the file to be imported?

Thank you.

Best

Christoph
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
I think you need a parameterized custom function that passes the file name as an argument.
You don't say what type of files you are importing - PQ has different functions for various file types being imported.
Here is a very sparse custom function with File Name as Parameter for importing CSV files.
(FileName as text) =>
let
    Source = Table.FromColumns({Lines.FromBinary(File.Contents(FileName), null, null, 1252)})
in
    Source

Open in new window



Here is a blog from Ken Puls on sharing, a solution which is not quite what you want, but with some modification, should get you what you want.

Write back to describe types of files, and what you think the Ken's blog... we can go from there.
TracyVBA Developer

Commented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial