Reading files in the input folder

Perform the following steps:

  1. First, let's add a new sequence to the project. Click on New and choose Sequence from the UiPath ribbon. Name the sequence as BuildExcelList and click Create.
  2. Before we configure the workflow, let's add the input arguments for the sequence InputFolder and OutputFolder, both of which are of the String type. Your workflow should look like this:

  1. Now, let's add a Try-Catch block for exception handling.
  2. Within the Try block, add the Excel Application Scope activity and set the workbook path to OutputFolder+"ImageDetails.xlsx". Within this scope, we will get the list of image paths from the input folder and write the image paths to the first column of the output file.
The Excel application scope opens the Excel workbook for you. You can create your Excel activities within this block. When you've finished executing this activity, the workbook and the Excel application will be closed.
  1. With the Excel scope set, use the value of the InputFolder argument to get all the files present in that folder path. To do that, add a For Each activity within the sequence and update the properties, as follows:
    • Set the TypeArgument property to Object.
    • Set the Values property to Directory.GetFiles(InputFolder). This will help us get all the files present in the InputFolder path.

Your workflow should now look like this:

Next, let's get ready to read and write the image file paths in the Input folder.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.166.241