Webダウンロード操作を繰り返す方法(StudioX)

初めまして。StudioXを最近使い始めて試行錯誤しています。

WebからCSVファイルをダウンロードしたいのですが、
1.「プルダウンで該当項目(今回事例で果物名とする)の果物名をクリック」
2.「ダウンロードボタンをクリック」
3.「ダウンロード時にそのフルパスを記憶させ、ダウンロードフォルダから指定フォルダへ移動しつつ、ファイル名を該当果物名に書き換える」

という手順を、りんご・みかん・いちごに対して実施したいです。
今は同じ処理内容を3回設置することでやりたい事を実現出来ていますが、Excelの繰り返し等を使用して処理は1つのグループ(手順1-3を1つとする)のみで実現出来ないでしょうか。
また、現在は手順1と3では、該当の果物名を直接テキスト入力で示していますが、今後果物が追加される事を想定して、テキストによるExcelに記載の果物の数だけ順番に見るようにしたいです。(例:Excel A列にりんご、みかん、いちご…と記入しておくファイルを持っておく)

色々調べると、例えばWEBの指定BoxにExcelのセル内容を順番に入力する…のような繰り返し処理についてはヒットするのですが、今回やりたいように、Webダウンロードは各果物ごとに完結し、次のダウンロードでExcelの次の行を読み込みたい…のような場合、何のアクティビティをどのように入れ子にすれば良いのかが分かりません。アドバイス頂けますと幸いです。
(自宅PCはUipathを使える環境ではないので、添付等出来ずにすみません)

@akiko_yoshimoto

you can follow this steps for your process

1.Read Fruit Names from Excel:

  • Use the “Excel Application Scope” activity to open the Excel file that contains the list of fruit names.
  • Use the “Read Range” activity to read the list of fruit names from the Excel file into a DataTable.
  1. For Each Row in DataTable:
  • Place a “For Each Row” activity to iterate through each row in the DataTable.
  1. Web Automation for Each Fruit:
  • Inside the loop, perform the following web automation steps for each fruit:
    • Use a “Type Into” activity to input the current fruit name into the web page’s search or selection box.
    • Click the relevant web elements to trigger the download.
    • Use the “Wait for Download” activity to ensure the download is complete and get the downloaded file path.
    • Use the “Move File” activity to move the downloaded file to the specified folder and rename it to the current fruit name.
  1. End of Loop:
  • The loop will automatically move on to the next fruit name in the DataTable and repeat the web automation steps.

Dear Mr.Praveen_Mudhiraj

Thank you for the very clear explanation!!
I understood the image of the loop.
I would like to try it on Monday. I learned a lot!! Thank you!!

1 Like

Cheers …!

@akiko_yoshimoto

日本語ですみません。先日はありがとうございました。
教えて頂いた内容で最初にやりたかったことがほぼ実現できました。

1点不明点があり、ご教授いただけますと今後の勉強になります。
「ファイルを指定したフォルダに移動して、ファイル名を現在のフルーツ名に変更する」の工程ですが、

ファイルを移動アクティビティの ”移動先" の設定で、フォルダパスとファイル名はExcelの各行(CurrentRow)で指定したパス & ファイル名を読み込みたいと思っています。(Excelの ”出力パス” 列に移動先のフォルダパス、”ファイル名" 列に変更したい該当果物名.csvを各行記載しています)

移動先:[CurrentRow] 出力パス¥[CurrentRow] ファイル名.csv
と設定したら、出力パスにファイルは移動されるものの、ファイル名が
[CurrentRow] ファイル名.csv となってしまいました。
正しく 果物名.csvと出力させるにはどのように移動先を設定すればよいでしょうか。
果物.csvを一度変数に格納する必要がありますか?
もしくは、Excel上であらかじめフォルダパス+ファイル名を書いてしまうというのも手でしょうか。
よろしくお願いいたします。

facing an issue with setting the destination path and file name when moving files to a folder and renaming them based on the fruit names from your Excel file. You want to dynamically set the destination path and file name for each fruit

you can follow this steps
1.In the “Move File” activity, you can set the destination path as follows:

[CurrentRow]出力パス + "\" + [CurrentRow]ファイル名 + ".csv"

This expression concatenates the output path from the “出力パス” column in Excel, the file name from the “ファイル名” column in Excel, and adds the “.csv” extension to create the complete destination path
2.Make sure to set the source file (the file you want to move) by indicating it on the screen.

By setting the destination path using the above expression, each file will be moved to the specified folder with the correct file name based on the fruit names from your Excel file. You don’t need to store the file names in variables, and you can dynamically generate the file path for each fruit.

@akiko_yoshimoto

Thank you once again for your very clear explanation !!
I’ll try again tomorrow.

Lets close this loop if your are cleared

@akiko_yoshimoto