UiPath Documentation
studiox
2022.4
false
StudioX ユーザー ガイド
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。

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

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

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

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

  • [ Excel ファイルを使用 ] アクティビティで、サプライヤー情報が保存された Excel ファイルを指定します。
  • A Copy Range activity to copy the data to another sheet.
  • 2 つの [フィルター ] アクティビティ: 目的とする基準に従ってデータをフィルター処理します。一方のアクティビティは Industry 列、もう一方のアクティビティは Supplier Since 列にそれぞれ適用します。
  • [ CSV に書き込み ] アクティビティで、フィルター処理したデータを CSV ファイルにコピーします。
  • [ デスクトップ版 Outlook アプリを使用 ] アクティビティで、メールの送信元とする Outlook アカウントを指定します。
  • [ メールを送信 ] アクティビティでメールを送信します。
  1. 手順 1: プロジェクトを設定し、必要なファイルを取得する

    1. Create a new blank project using the default settings.
    2. このチュートリアルでは、このページ下部にあるボタンを使用して、オートメーション プロジェクトを収めたアーカイブをダウンロードして展開します。プロジェクト フォルダーにファイル Suppliers.xlsx をコピーします。
  2. 手順 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. 手順 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 Range. A Copy Range activity is added to the Designer panel.

    2. [範囲をコピー] アクティビティで、次の操作を行います。

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

      • Click Plus ドキュメントの画像 on the right side of the Destination range 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 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 range 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.

        • ClickAdd to add a second value.

        • ドキュメントの画像2 番目の[値] フィールドの右側にある プラス 記号 をクリックし、[ テキスト] を選択します。テキスト ビルダーに「 ITauto」と入力して [ 保存] をクリックします。 [OK ] をクリックして [フィルター] ウィンドウを閉じます。

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

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

        • ドキュメントの画像[値] フィールドの右側にある プラス 記号 をクリックし、[ テキスト] を選択します。テキスト ビルダーに、10 年前の日付 (例: 5/5/2009) を入力して [ 保存] をクリックします。[ OK ] をクリックして [フィルター] ウィンドウを閉じます。

          これにより、列 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 Project Notebook (Notes) > Date [Sheet] > YYYYMMDD [Cell]. The text in the Text Builder is updated to result-Excel Date!YYYYMMDD. Enter the text .csv at the end and click Save. The final text should be result-Excel Date!YYYYMMDD.csv.

      • ドキュメントの画像[書き込み元] フィールドの右側にある プラス 記号 をクリックし、[ Suppliers > Processed [シート]] を選択します。

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

  4. 手順 4: CSV ファイルをメールで送信する

    Processed シートのデータがフィルター処理され、名前に今日の日付を含む CSV ファイルにコピーされます。次に、この 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 theUse 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 From 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 Is 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 Project Notebook (Notes) > Date [Sheet] > Today [Cell]. The final text should look like this: List of filtered suppliers for [Excel]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.

      • [添付ファイル] には [ファイル] を選択し、フィールドの右側にあるプラス記号 ドキュメントの画像 をクリックしてから、[テキスト] を選択します。テキスト ビルダーで、[CSV に書き込み] アクティビティに入力したのと同じ方法(result-Excel Date!YYYYMMDD.csv)でファイル名を入力します。その方法の 1 つとして、[CSV に書き込み] アクティビティの [書き込み先ファイル] フィールドのテキスト ビルダーですべてのテキストを選択し、そのテキストをコピーし、[添付ファイル] フィールドのテキスト ビルダーに貼り付けることができます。

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

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

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得