DataRow変数の列を1つずつNullOrWhiteSpaceでないかどうか調べたい

UiPath Studio 2023.6.1 Community Editionを利用中の初心者です。

DataRow変数dr_TransactionItemの列を1つずつNullOrWhiteSpaceでないかどうか調べ、YESの場合はThenを実行するWFを作成したいです。
考え方としては、

1.DataRow変数dr_TransactionItemの列数int_item_numberを調べる。
2.dr_TransactionItem(n)のnを0始まりでint_item_number-1まで回し、該当列がNullOrWhiteSpaceであればThenを実行する。

で良いのではないかと考え、添付のWFを作成してみましたがスキル不足で完成できませんでした。
正解が分かる方、ご教示ください。
1.はdt_TransactionData変数からDataRow変数の列数をカウントしましたが、DataRow変数dr_TransactionItemから列数を直接調べる方法があればご教示ください。

@gorby

As your are using in reframework then no need of for each activity

Because reframework
Has inbuilt transactional process

Sorry, But I cannot understand what you are saying.

Use for each row in datatable and pass value as dttransactiondata

Inside of it

Use
Currentitem.tostring.equals(“”)

Hi Your advice is still ambiguous for me…
How I iterate each column in dt_transactionData ?

In for each activity

Pass this dttransactiondata.columns

This will give you to iterate through columns

I cannot understand what you are saying. Pls refrain from answering if you are not serious.

@gorby

Hope this not gives You the answer ,I Will exit

1 Like

こんにちは

スクリーンショットはdt_TransactionData.columns.Countとなっているので説明と異なります。
これでも列数は取得できますが、dt_TransactionDataはDataTableではないでしょうか?
DataRowから取得する場合は、dr_TransactionItem.ItemArray.Length で取得できると思います。

2.dr_TransactionItem(n)のnを0始まりでint_item_number-1まで回し、該当列がNullOrWhiteSpaceであればThenを実行する。

このロジックですとRepeatNumberOfTimesを以下のように使うと良いと思います。

なお事前に列数を算出せずとも直接ItemArrayをイテレートしたほうがアクティビティ数は少なく記述できると思います。

1 Like