How to create a "select file" or "select folder" element in new UiPath Forms

I finally figured this out!

Add a Text Field to your form, Field Key is file. Set it to disabled (optional).

Add a button, Action is event, Field Key is selectFile, label is Select File.

Now mouse over the button and click the Create Trigger icon:

image

Name the form trigger and click Create:

image

In the Form trigger activity, choose “Select File clicked” for Event:

image

Add a Browse For File activity, output the path to SelectedFile:

image

Add a Set Form Values activity.

image

In the Dictionary, assign the SelectedFile value to the file object:

image

NOTE: If the Arguments field is locked/disabled, add a value to (or remove the value from) the Instance Name field. The change in this field seems to trigger unlocking the Arguments.

Now your Select File trigger looks like this:

Make sure you have a Run Local Triggers after you display the form:

image

Run your automation, click the Select File button, select a file (sometimes the window appears behind others and you have to look for it), and then click Open, and VOILA now you have a text box on the form that has the file path in it!

image