フォルダにあるファイル名のリスト化について

こんにちは。

フォルダにあるファイル名をSystem.IO.Directory.GetFilesを使って取得し、メッセージボックスに表示することはできたのですが、これをリストとしてエクセルに保存するにはどうすればよいでしょうか?

@Tadi

Welcome to the UIpath Community.

  1. use Build dataTable Activity to create dataTable with one ColumnName and store output in dataTable say ‘DT’.

  2. strFiles [ ] = Directory.GetFiles(“FolderPath”)

The above expression will give you array of files. Then use For Each loop to itreate that array. Inside this loop use, Add DataRow Activity.

ForEach item in strFiles
use Add DataRow Activity and mention below

ArrayRow: {item}
dataTable: DT

  1. Finally use Write Range Activity to write into Excel file and pass that DataTable DT.