activities
latest
false
UiPath logo, featuring letters U and I in white
Workflow Activities
Last updated Nov 18, 2024

Get File/Folder path

This is a step-by-step tutorial showing you how to prompt a user to browse for a file or folder path and then add it inside a form field.
  1. Create a form called Find the Path with two text fields and two buttons. One text field and button will be used for displaying and selecting a folder path, while the other will be used for displaying and selecting a file path. Set the field keys as folderPath and filePath for the respective text fields.


  2. In your Main workflow, add a Show Form activity to display the Find the Path form to the user. Then add a Run Local Triggers activity to fire all the triggers in the project.
  3. Create a workflow named Get folder path, and add a Form trigger activity, where the triggering event is when the get folder path button is clicked.
    1. To open the file explorer and allow the user to browse for a folder, add a Browse for Folder activity and save the Selected folder path to a variable.
    2. To map the folder path back into the form, add a Set Form Values activity and input the variable created previously as the value of the folderPath key.
  4. To prompt a user to browse for a file path and then add it inside a form field, perform the same steps as above, with the following changes:
    1. Change the Labels and Property Names to filePath.
    2. Use a Browse for File activity, instead of a Browse for Folder.
Results


Workflow example

To follow the steps and try out the automation yourself, see the sample workflow.

  • Workflow example

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.