Unable to post data in multiple columns of a DataTable

Hello Team!
I’m new to UiPath, and now I need assistance in creating a datatable containing two columns:

  1. A filename and 2. the path for the file.
    I would like the final datatable to look like this:
    image

I’m able to get both the filename and filepath out of the directory (also the ones from the subfolder), but I’m having issues posting the filepath into the 2. column (FilePath).
I can add a data row with both name and path in the loop, but it will only post in the 1st column (FileName), and it will look like this:

image

The next step in my program is to compare the column with the filename to a different table containing filenames, and if there is a match, the filepath from the 1st datatable has to be used - that’s why I need them side by side.

All help is gladly accepted and appreciated - keep in mind that I’m new to automation, so simple explanations will be greatly appreciated! :slight_smile:

Thank you in advance.

Hi @Laurits
After getting the file pathname and filepath

Use build datatable activity

use add data row pass the filename variable and filepath variable to array row{filename.tostring,filepath.ToString}
dont loop it based on for each

Thanks
Ashwin S

1 Like

Thank you very much Ashwin!
Can’t believe it was actually so simple, I definitely learned - and it’s a great example on how the UiPath Forum can give quick help! :smiley:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.