Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Server Knowledge Base

Definitive answers from Server experts.

Folder Browse Not Available on Gallery Workaround

DanC
Moderator
Moderator
Created

Question

Is there a workaround for not being able to use the Folder Browse Tool in the Gallery?

Answer

First, some background. As the help section says, "This Interface tool is not supported for running apps in the Alteryx Analytics Gallery."There are several reasons for this:

  1. It is considered a security risk to allow users to browse the folder structure on the server.
  2. The Gallery is designed to run in a multi-node server environment, so there would an issue as to which server the user would be browsing the folder structure for.
  3. Many browsers do not support folder browse.

Though it may not be as clean as being able to use the Folder Browse Tool, the simple workaround for this is to use the Text Box Interface Tool instead. This will allow the user to copy a directory path from Windows Explorer and paste it into the Text Box. In the workflow, all you need to do is connect the Text Box Tool to an Output Data Tool and have the Action Tool update the path portion of the Output Data Tool. You can even enter in a default path in the Default Text section of the Text Box if there is a path that is most commonly used.

Example:

Workflow.png

In the Output Data Tool, make a placeholder (in this example, "__DIR__" is used) for the directory:

OutputTool.png

In the Action Tool, configure so that the placeholder in the Output Data Tool gets replace with what the user entered in the Text Box Interface Tool:

ActionTool.png

Sample workflow, created in 11.0, attached.

Common Errors Encountered when a Folder Browse is placed on Gallery

Problem Loading App

Unknown error, TypeLoadException RequestID: ____________________

Please feel free to ask any questions or leave any comments. Thank you!

Attachments
Comments
oliver_huber
7 - Meteor
Hi DanC, this approach only allows for defining a path ON THE SERVER the gallery runs, correct? It would not allow a user to point to a folder on ON HIS COMPUTER, correct? I tried your approach using a "directory" tool instead of the "output data" one in your example; I can run the app on the localhost pointing to a directory on the localhost on which the gallery runs. However, connecting to the gallery from the outside word ("http://my_gallery/gallery") fails when I point to a local folder. Any hints on how to achieve letting the user browse on his own computer to point to one of his directories?
SeanAdams
17 - Castor
17 - Castor

Hey @oliver_huber,

 

the complication with files on a user's local machine is that analytical apps are running from the security context of the Server's login.   That means that it probably will not have any access to files on a user's machine.

 

What you can do is to get your users do drop the files they want to work with, on a network location that the server login has permission to access.     You can address this using a UNC path like \\servername\share\folder

 

Hopefully this helps - the trick here is the security context and the fact that any browse operation being done from an Analytical app is done from the security context of the server login.

Mahadeva
8 - Asteroid

Hi oliver_huber

 

Even I'm facing the same issue, user is unable to select his local folder.

Appreciate if you have found any workaround for this.

 

Regards,

Mahadev

JessicaS
Alteryx Alumni (Retired)

Moderators Note:

 

We edited this post to contain a common error message users encounter when a folder browse is placed on the gallery to make the post easier to search by the error message.

 

@MarqueeCrew  @patrick_mcauliffe 

CamodCPA
8 - Asteroid
afinzerillo
8 - Asteroid

This is unfortunate.  We've developed an app that allows a user to dynamically point to a network share to select 90+ input files.  The location of files changes from week to week and month to month.  But, we can't share this app to Gallery because of this limitation.  This workaround would necessitate someone modify the app every time they want to run.  Kind of defeats the purpose.

pokhan27
8 - Asteroid

hi @DanC 

can we do the same with the input, as i am trying to select the folder for input. 

 

i tried but am having input issue

DavidMorrissey
6 - Meteoroid

Perhaps someone can enlighten me--I don't see the relevance of points 1 and 2 in the original post. Of course users should not be accessing the server's folder structure. But the File Browse tool allows the user to browse *their own* network folders on the way to selecting a file. Why on earth can't the Folder Browse tool use the same functionality to select one of those folders, instead of a file? 

 

I'm sure there must be some underlying technical hurdle, but from the user's point of view, it seems inexcusable that the software lacks so simple a function as browsing to a folder. I'm amazed this hasn't been a priority to fix.

 

Would appreciate any insights. Thanks!

lepome
Alteryx Alumni (Retired)

@DavidMorrissey 

No, not really.  The tool, when used in a workflow on a user's machine allows the user to browse folders (any folders that the software can see).  But the tool has no way of knowing who is running the workflow on a server.  By default, the server doesn't know who is running a workflow on the server--just that a user who has access to that workflow has chosen to run it.  The reasons stated in this article are real reasons.

DavidMorrissey
6 - Meteoroid

Hi @lepome,

 

Thanks for your reply. But in that case, why does the File Browse tool work? Users can only browse to files (inside folders) that they have access to, so clearly the server knows who is running the workflow.

 

Thanks!

lepome
Alteryx Alumni (Retired)

@DavidMorrissey 

There are fundamental differences between the two tools.

The File Browse tool triggers the browser to allow uploading of a file.  The Folder Browse tool opens a Folder window on the machine running the workflow.  If you run both on your own machine, they may look similar to you, but I think you will find that they are not the same.

Not the sameNot the same

 

DavidMorrissey
6 - Meteoroid

Thanks @lepome. That helps explain why the Folder Browse behaves differently as designed, but not why it was designed that way in the first place. As evidenced by the File Browse tool, it is perfectly possible, in the server environment, to respect security protocols and still allow the user to browse through their own network folders. That being the case, it would seem trivial (at least to a non-programmer!) to use similar functionality to grab a folder path, rather than a file. It's hard to believe that there's no way for either of these tools to be updated (or a new tool added) that would allow this extremely basic operation.

 

Thanks!

KyleF
7 - Meteor

@DavidMorrissey The solution I'm using is to use the "File Browse" tool but then in the Action tool I use the "Update Value With Formula" and use the formula FileGetDir([#1]) to change the directory field in a Directory tool that then goes to a Dynamic Input. The only annoying piece is that the user needs to know that they are just selecting ANY specific file (and also sheet) in the desired folder and then the process does the rest.

DavidMorrissey
6 - Meteoroid

@KyleF Thanks! We've tried something similar in the past, but as you point out, it can be confusing for the end user. Pretty sad that Alteryx requires a confusing workaround to do something as basic as selecting a folder. Regardless, I bet some builders will find your method useful, so thanks again!  

allisonlevyHAL
5 - Atom

Hello. I am running into this issue, however we need the directory tool / file browse tool to be at the beginning of the workflow, as the user is trying to bring in an entire folder. It seems this is not possible with the workaround. Is there any other solution for this?