UiPath Documentation
studiox
2023.10
false

StudioX user guide

最終更新日時 2026年4月30日

チュートリアル: Excel データをフィルター処理する

このチュートリアルでは、以下のプロセスを実行するオートメーションを作成します。

  1. サプライヤー情報が保存されたスプレッドシートのデータを新しいシートにコピーします。
  2. サービス業界と IT 業界に属し、過去 10 年間に追加されたサプライヤーの行のみが表示されるように、データをフィルター処理します。
  3. フィルター処理したデータを CSV ファイルにコピーします。
  4. この CSV ファイルをメールで送信します。

以下のアクティビティから成るプロジェクトを作成します。

  • A Use Excel File activity to indicate the Excel file with supplier information.
  • A Copy/Paste Range activity to copy the data to another sheet.
  • Two Filter activities to filter the data according to the desired criteria: one filter for the Industry column, the other for the Supplier Since column.
  • A Write CSV activity to copy the filtered data to a CSV file.
  • A Use Desktop Outlook App activity to indicate the Outlook account from which to send the email.
  • A Send Mail activity to send the email.
  1. プロジェクトを設定し、必要なファイルを取得します。
    1. Create a new blank project using the default settings.
    2. このチュートリアルでは、このページ下部にあるボタンを使用して、オートメーション プロジェクトを収めたアーカイブをダウンロードして展開します。プロジェクト フォルダーにファイル Suppliers.xlsx をコピーします。
  2. Excel ファイルをプロジェクトに追加します。
    1. Click Add Activity ドキュメントの画像 in the Designer panel, and then find the Use Excel File activity in the search box at the top of the screen and select it. A Use Excel File activity is added to the Designer panel.
    2. アクティビティで次の操作を行います。
      • Click Browse ドキュメントの画像 next to the Excel file field, and then browse to and select the file Suppliers.xlsx

      • [参照名] フィールドに「Suppliers」と入力します。

        これで、このオートメーションでは名前を Suppliers としたファイル Suppliers.xlsx を操作対象として指定したことになります。

  3. データをフィルター処理し、CSV ファイルにコピーします。
    1. Click Add Activity ドキュメントの画像 inside the Use Excel File and then, in the search box at the top of the screen, locate and select Copy/Paste Range. A Copy/Paste Range activity is added to the Designer panel.

    2. [範囲をコピー/貼り付け] アクティビティで、以下の手順を実行します。

      • Click Plus ドキュメントの画像 on the right side of the Source field, and then select Suppliers > Data [Sheet].

      • Click Plus docs image on the right side of the Destination field, and then select Suppliers > Processed [Sheet].

        これで、Suppliers ファイルの Data シートからデータをコピーし、同じファイルの Processed シートに貼り付けるように指定したことになります。

    3. StudioX のリボンで [保存] をクリックしてオートメーションを保存し、[実行] をクリックしてオートメーションを実行します。

      Suppliers ブックの Data シートから Processed シートにデータがコピーされます。

    4. Click Add Activity ドキュメントの画像 inside the Use Excel File just below the Copy/Paste Range activity, and then, in the search box at the top of the screen, locate and select Filter. A Filter activity is added to the Designer panel.

    5. [フィルター] アクティビティで、以下の手順を実行します。

      • Click Plus ドキュメントの画像 on the right side of the Source field, and then select Suppliers > Processed [Sheet].
      • Click Plus ドキュメントの画像 on the right side of the Column name field, and then select Range > Industry.
      • [フィルターを設定] ボタンをクリックします。[フィルター] ウィンドウで [基本的なフィルター] が選択されていることを確認します。
        • Click Plus ドキュメントの画像 on the right side of the Value field, and then select Text. In the Text Builder, enter Services, and then click Save.

        • Click Add to add a second value.

        • Click Plus ドキュメントの画像 on the right side of the second Value field, and then select Text. In the Text Builder, enter IT, then click Save, and then click OK to close the Filter window.

          これにより、Industry 列の値が Services または IT である行のみを表示するために、Processed シートのデータをフィルター処理するように指定したことになります。

    6. Click Add Activity ドキュメントの画像 inside the Use Excel File just below the Filter activity, and then, in the search box at the top of the screen, locate and select Filter. A second Filter activity is added to the Designer panel.

    7. 2 番目の [フィルター] アクティビティで、以下の手順を実行します。

      • Click Plus ドキュメントの画像 on the right side of the Source field, and then select Suppliers > Processed [Sheet].
      • Click Plus ドキュメントの画像 on the right side of the Column name field, and then select Range > Supplier Since.
      • [フィルター] ボタンをクリックします。[フィルター] ウィンドウで、以下の手順を実行します。
        • [高度なフィルター] を選択します。

        • [演算子] ドロップダウン メニューから [>] (より大きい) を選択します。

        • Click Plus ドキュメントの画像 on the right side of the Value field, and then select Text. In the Text Builder, enter a date from 10 years ago, for example 5/5/2009, then click Save, and then click OK to close the Filter window.

          これにより、列 Supplier Since の値が 5/5/2009 より後である行のみを表示するために、Processed シートのデータをフィルター処理するように指定したことになります。

    8. フィルターをより簡単に識別するには、各フィルターの上部のバーで名前を編集します。たとえば、最初のフィルターには Filter Industry、2 番目のフィルターには Filter Supplier Since を使用します。

    9. Click Add Activity ドキュメントの画像 just below the Use Excel File activity, and then, in the search box at the top of the screen, locate and select Write CSV. A Write CSV activity is added to the Designer panel. Alternatively, you can also add this activity inside the Use Excel File activity, just below the last Filter activity.

    10. [CSV に書き込み] アクティビティで、以下の手順を実行します。

      • Click Plus ドキュメントの画像 on the right side of the Write to what file field, and then select Text. In the Text Builder, enter result-, and then from the Plus ドキュメントの画像 menu on the right side of the Text Builder select Notebook > Date [Sheet] > YYYYMMDD [Cell]. The text in the Text Builder is updated to result-[Note] Date!YYYYMMDD. Enter the text .csv at the end and click Save. The final text should be result-[Note] Date!YYYYMMDD.csv.

      • Click Plus ドキュメントの画像 on the right side of the Write from field, and then select Suppliers > Processed [Sheet].

        これで、名前にテキスト「result-」および今日の日付を含む CSV ファイルをプロジェクト フォルダーに作成し、Processed シートのデータをそのファイルにコピーするように指定したことになります。

        ドキュメントの画像

  4. CSV ファイルをメールで送信します。
    1. Click Add Activity ドキュメントの画像 below the Use Excel File activity, and then find the Use Desktop Outlook App activity in the search box at the top of the screen and select it. A Use Desktop Outlook App activity is added to the Designer panel.

    2. このアクティビティの [アカウント] フィールドには、あらかじめ既定のメール アカウントが入力されています。別のアカウントを使用する場合は、ドロップダウン メニューから選択します。

      [参照名] フィールドは既定値 Outlook のままとして、オートメーションでアカウントを参照するときは、この名前を使用します。

    3. Click Add Activity ドキュメントの画像 inside the Use Desktop Outlook App activity, and then, in the search box at the top of the screen, locate and select Send Email. A Send Email activity is added to the Designer panel.

    4. [メールを送信] アクティビティで、以下の手順を実行します。

      • Click Plus ドキュメントの画像 on the right side of the Account field, and then select Outlook.

      • Click Plus ドキュメントの画像 on the right side of the To field, and then select Text. In the Text Builder window, enter an email address where to send the email. For example, you can enter your own email address to send the email to yourself. If you leave the Save as draft option selected, the automation does not send the email, it instead saves the email to the Outlook Drafts folder.

      • Click Plus ドキュメントの画像 on the right side of the Subject field, and then select Text. In the Text Builder window, enter List of filtered suppliers for , and then, from the Plus ドキュメントの画像 menu on the right side of the Text Builder, select Notebook > Date [Sheet] > Today [Cell]. The final text should look like this: List of filtered suppliers for [Notes]Date!Today. Click Save to close the Text Builder.

      • Click Plus ドキュメントの画像 on the right side of the Body field, and then select Text. In the Text Builder window, enter text for the body of the email, for example Please see attachment.

      • For Attachments, select Files, then click Plus ドキュメントの画像 on the right side of the field, and then select Text. In the Text Builder, enter the file name in the same way you entered it in the Write CSV activity: result-[Notes] Date!YYYYMMDD.csv. One way you could do this is to select all the text in the Text Builder of the Write to what file field in the Write CSV activity, copy the text, and then paste it to the Text Builder of the Attachments field.

        ドキュメントの画像

    5. Click Save on the StudioX ribbon to save the automation, then click Run to execute the automation.The data in the Processed sheet is filtered, then copied to a CSV file that has today's date in the name, and then the CSV file is emailed. Download example

このページは役に立ちましたか?

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得