Choose local path in dashboard

Is there a possibility to provide the user a way to choose resp. to select a folder on the machine?

In my case, Server and User is on the same machine, in case this plays a role. I created an app that analyzes excel files and I want to be able to choose the folder where they are located. Is there a way to do so?
Thanks a lot in advance!

Hello @DeLaRiva,

Give a look here and see if there is anything that helps you out:

1 Like

Thanks for forwarding me towards this thread. Tbh, I’m not so well used to plotly which makes it a bit hard for me to identify the needed input there.
But I assume How to create a collapsible sidebar with tree structure of uploaded files - #8 by andrew-hossack? is what I am looking for? Could you please confirm this?
But as I see correctly this is mainly or only addressing how to visualize a given path? How do I let the user choose the path in the first instance?
Thank you!

Yes, that’s what I was alluding to.

You can create some sort of navigation when selecting the directories. If not populated with info, then you populate it with a callback.

Sorry, I don’t understand what you’re saying. Could you please rephrase it somehow?

I’m thinking about a workaround: It is probably possible to enter text through some UI-gadget and this I should be easily be able to use as a path from there on, right?

The question just is how to actually do that. There must be something like a pre-app that pops up with only the text input and a confirmation button and then the actual app and stuff commences. Is this somehow doable?

You could initiate your app with command line arguments. One of those arguments could be the path you are referring to.

EDIT: Actually I’m not sure if this works :slight_smile:

What I did in the past is creating a config.py file which I import in the app.py.

something like this:

config.py:

my_path = '...'

app.py

import dash 
import config

path_to_use = config.my_path

app = dash.Dash(__name__)
app.layout = html.Div(path_to_use)

app.run()
2 Likes

Not pretty but a very efficient workaround :slight_smile:
Thank you!

Yeah, I know I’m not going to win a beauty contest with this one :see_no_evil: :rofl:

1 Like