Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Default folder location before interface tool input

thrnma
7 - Meteor

Hello!

 

I have contributed to a workflow that is set up to go on the Alteryx Server to be used in a self-serve way by the wider team. This all works fine and I am able to enter input and output directory locations on the server. The workflow will then go to that directory and be performed on all the files in there, before outputting to a defined location.

 

In order to make it more user friendly, I want the user to just enter a country code to define the folder. For example, the folder location would be similar to:

.../ReportInput/UK/ or .../ReportInput/DE/

I would like it so the .../ReportInput/ part of the folder location is behind the scenes, as this will not change. So by the user typing in the box 'UK', it will direct them to the .../ReportInput/UK folder.

I am currently using the text input along with the directory tool (as seen in the image).

 

Thank you for your help!

thrnma_0-1614269291049.png

 

1 REPLY 1
kelly_gilbert
13 - Pulsar

Hi, @thrnma - here's one way to do that:

 

  • In your Action tool, change the action type to Update Value with Formula
  • Make sure that the Directory - value is highlighted
  • In the Formula at the bottom, enter the formula "your path\ReportInput\" + left([#1],2)
    • Make sure the first part of the path is in quotation marks
    • [#1] is the input from the text box, so this will just append the user's input to the end of the path (for example, UK or DE)
    • The reason for left() is to prevent injection (e.g. prevent the user from entering a folder name other than a two-character)

 

kelly_gilbert_0-1614377885127.png

 

 


A couple of things to consider:

  • You may want to use a drop-down instead of a text box, to make sure the user selects a valid option (for example, the user could mis-key "UJ" instead of UK)
  • You may want to require the user's credentials. When the workflow runs on the gallery, it will likely run using the server's user rather than the individual person using the app. The server probably has access to more files than the individual users. 
    • For example, maybe the users in Germany shouldn't have access to the UK folder, and vice versa. However, the server has access to all of the folders. If a user in Germany enters "UK" in the app, then they would be able to modify data in the UK folder because the app is running as the server's user ID, and not the individual. 
    • If you set the app to require the user's credentials, the user will have to enter their username and password when they run the app, and it will error out if the user doesn't have access to the specified folder.
    • When you save the workflow to your private gallery, click on Workflow Options, then choose Set workflow credentials --> User must specify their own credentials

 

Also, in Designer, if you right-click on the Action tool in the palette, you can choose Open Example to see several examples of different configurations you can use in the Action tool.

 

kelly_gilbert_1-1614377358207.png

 

Labels