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

チュートリアル: 表の行を反復処理する

このチュートリアルでは、Excel の表で Transaction # の値がまだ入力されていないすべての行ごとに、以下のワークフローを繰り返すオートメーションを作成します。

  1. Cash In 列のセルから値をコピーします。
  2. この値をデスクトップ アプリケーションのフィールドに貼り付けます。
  3. デスクトップ アプリケーションからトランザクション番号をコピーします。
  4. この値を Transaction # 列のセルに貼り付けます。
  5. デスクトップ アプリケーションのボタンをクリックしてデータを送信します。

プロジェクトを作成したら、まずは使用する Excel ファイルを指定する [ Excel ファイルを使用 ] アクティビティを追加します。このカードに [ 繰り返し (Excel の各行 )] アクティビティを追加して、行ごとにアクティビティを繰り返すように指示します。Excel ファイルの中で、Transaction # の値が存在しない行に対してのみオートメーションを実行する必要があるので、[繰り返し (Excel の各行)] アクティビティに [条件分岐 (if )] アクティビティを追加します。これにより、Transaction # のセルが空であるという条件を満たす行に対してのみ、自動化するアクティビティが実行されるように指定します。

  1. 手順 1: プロジェクトを設定し、必要なファイルを取得する

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

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

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

  3. 手順 3: Excel ファイルの行に対して反復処理する

    1. Click Add activity ドキュメントの画像 inside Use Excel File, and then, in the Common Scenarios section of the search box at the top of the screen, click Repeat actions for rows in Excel range. An For Each Excel Row activity is added to the Designer panel inside the Use Excel File activity.

    2. [繰り返し (Excel ドキュメントの画像の各行)] アクティビティで [ 対象範囲] フィールドの右側にある プラス 記号 をクリックします。つづいて [ UID] >[Input [シート]] > [ Transaction [テーブル]] を選択して、ファイル UID の Input シートでテーブル Transactions を選択します。[ 対象範囲 ] フィールドに、選択したテーブルが [UID] Transactions として表示されます。

      これで、Transactions 表の行に対して反復処理を実行するように指定したことになります。

  4. 手順 4: アクティビティを実行するために満たす必要がある条件を追加する

    1. Click Add activity ドキュメントの画像 inside the For Each Excel Row activity and then, in the search box at the top of the screen, locate and click If. An If activity is added in the Use Application/Browser activity.

    2. In the If activity, click Plus ドキュメントの画像 on the right side of the Condition field, and then select Condition Builder.

    3. 次の手順に従い、条件ビルダーに条件として「現在の行の Transaction # が空の場合」を追加します。

      • Click Plusドキュメントの画像 on the right side of the field on the left, and then select CurrentRow > Transaction # to select the Transaction # value from the current row you are iterating through as the value to evaluate in the condition.

      • 中央のドロップダウン メニューから、[空] を選択します。

        この条件を満たす行について、[条件分岐 (if)] アクティビティの [Then] 分岐に追加したアクティビティが実行されます。

  5. 手順 5: デスクトップ アプリケーションを追加し、条件が満たされたときにそのアプリケーションで実行するアクティビティを追加する

    UID テーブルの中で Transaction # の値が入力されていない各行の Cash In の値が DoubleUI アプリケーションに入力され、DoubleUI アプリケーションの Transaction # が UID テーブルの各行にコピーされます。

    1. Click Add activity ドキュメントの画像 inside the Then branch of the If activity and then, in the search box at the top of the screen, locate and click Use Application/Browser. A Use Application/Browser activity is added in the Then branch of the If activity.

    2. [アプリケーション/ブラウザーを使用] アクティビティで [画面上でターゲットを指定] をクリックしてから、DoubleUI のウィンドウ内部にマウス ポインターを移動します。ウィンドウが強調表示されるので、DoubleUI の任意の場所をクリックします。

      [アプリケーション/ブラウザーを使用] アクティビティが更新され、アプリケーション ウィンドウのスクリーンショットがアクティビティに表示されます。

    3. Click Add activity ドキュメントの画像 inside the Use Application/Browser activity and then, in the search box at the top of the screen, locate and click Type Into. A Type Into activity is added in the Use Application/Browser activity.

    4. [文字を入力] アクティビティで次の操作を行います。

      • [画面上でターゲットを指定] をクリックし、DoubleUI.exe アプリケーションの [Cash In] フィールドにマウス ポインターを移動します。フィールドが強調表示されたらクリックします。テキスト フィールドがターゲットとして、フィールドの横の [Cash In] ラベルがアンカーとして識別されます。[選択オプション] ウィンドウの [確認] をクリックして選択内容を保存します。ターゲットとアンカーの画像が [文字を入力] アクティビティに表示されます。

        これで、DoubleUI.exe アプリケーションの [Cash In] フィールドに文字を入力するように指定したことになります。

      • Click Plusドキュメントの画像 on the right side of the Type this field, and then select CurrentRow > Cash In to select the Cash In value from the current row you are iterating through as the value to type.

    5. Click Add activity ドキュメントの画像 inside the Use Application/Browser activity below the Type Into activity and then, in the search box at the top of the screen, locate and click Get Text. A Get Text activity is added in the Use Application/Browser activity after the Type Into activity.

    6. [テキストを取得] アクティビティで、次の操作を行います。

      • [画面上でターゲットを指定] をクリックし、DoubleUI.exe アプリケーションの [Transaction #] の値にマウス ポインターを移動します。値が強調表示されたらクリックします。[Transaction #] の値がターゲットとして、値の横のラベルがアンカーとして識別されます。[選択オプション] ウィンドウの [確認] をクリックして選択内容を保存します。ターゲットとアンカーの画像が [テキストを取得] アクティビティに表示されます。

        これで、DoubleUI.exe アプリケーションの [Transaction #] の値をコピーするように指定したことになります。

      • Click Plusドキュメントの画像 on the right side of the Save to field, and then select CurrentRow > Transaction # to select the Transaction # column on the current row you are iterating through as the cell where to paste the value copied from the application.

    7. Click Add activity ドキュメントの画像 inside the Use Application/Browser activity below the Get Text activity and then, in the search box at the top of the screen, locate and select Click.

      これにより、[アプリケーション/ブラウザーを使用] アクティビティで [テキストを取得] アクティビティの後に [クリック] アクティビティが追加されます。

    8. [クリック] アクティビティで [画面上でターゲットを指定] をクリックし、DoubleUI.exe アプリケーションの [Accept] ボタンにマウス ポインターを移動します。ボタンが強調表示されたらクリックします。[Accept] ボタンがターゲットとして、[Cancel] ボタンがアンカーとして識別されます。[選択オプション] ウィンドウの [確認] をクリックして選択内容を保存します。ターゲットとアンカーの画像が [クリック] アクティビティに表示されます。

      これで、DoubleUI.exe アプリケーションの [Accept] ボタンをクリックするように指定したことになります。

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

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

接続

ヘルプ リソース サポート

学習する UiPath アカデミー

質問する UiPath フォーラム

最新情報を取得