PowerApps - How do I create a folder picker

1.5k Views Asked by At

I'm building a canvas PowerApp / Component using React and FluentUI (office-fabric-ui).
(if that limits the ways to solve this feel free to ignore the React part)

Using context.device.pickFile() (documentation) I can trigger a file picker dialog. I added this to my component, tested that in a PowerApp and it works as you'd expect.

However, what I am really looking for is a folder browser. Of course I could ask the user to use the filePicker to select a file in a directory and then get the directory name from that, but that's just a workaround... and what if there is no file to pick in the target directory?

Is there a way to trigger a folder browser?

1

There are 1 best solutions below

6
Arun Vinoth-Precog Tech - MVP On

From this SO thread, I believe the below snippet should work.

<input directory="" webkitdirectory="" type="file" />

You can play round and experience it using this code sandbox.