I just want to ask for your assistance on how to get the Filenames of the Files that are saved in the Downloads Folder, in this matter - a pdf file. And after that, these filenames are extracted/copied and should be written and saved in Excel/Notepad. Looks pretty simple but I am having troubling how should get this done.
I am using UiPath Studio 2023.8.0 Community Edition.
Use a ForEach file in the folder activity loop inside the loop youput an assign activity and use he left side field as Path.GetFilename(file) to get the filename only.
Then use a write cell to write it back to Excel
Or you can build a datatable and write all the filenames a once
Please refer below file and add some pdf to the directory New folder (3).zip (11.0 KB)
Hi @jharmel.carmona
=> Use For Each file in Folder to iterate through each file and give filter by "*.pdf"
=> Use Assign activity and give below condition:
FileName= CurrentFile.Name
The above syntax will retrieve the file name with extension
FileName= CurrentFile.FullName
The above syntax will retrieve the whole file path of the particular file with extension
The above syntax will retrieve the whole file name of the particular file without extension.
=> Use Write Text File to write all the filenames into a Notepad or use Append Line so that every time it gets appended to same file.