DataRowの検索について

Book1.xls (17.5 KB)

データテーブルの行の固有内容と、インプットダイアログから月を入力した該当列のデータをもとに
新規のデータテーブルを作成したいのですが、
DataRowの中でのループがうまくできません。

何か良い方法はありますか?

1 Like

Fine
we can use BUILD DATATABLE ACTIVITY to create a new datatable with columns we want and get the output with a variable of type datatable named outdt
–now use a excel application scope and pass the file path of excel as input
–inside the scope use a read range activity and get the output with a variable of type datatable named dt
–now use a for each row loop and pass the variable dt as input
–inside the loop use a if condition and validate the column value we want
row(“yourcolumnname”).tostring.equals(“yourvalue”)
if the condition passes it will go to THEN part where we can use a activity called ADD DATAROW activity where in the datatable mention as outdt and in the ArrayRow property mention as row.ItemArray in the property panel of add data row activity

hope ths would helpyou
Cheers @rena168

I want to know find tha “yourvalue”'s index in row.
Please help me!
Thanks you very much!

1 Like

no worries
i meant yourvalue as the the column value that we want to validate
Cheers @rena168

Hi,Thanks.
How can i get has “yourvalue”'s index in row?

use indexOf?
But this method can not.

以下が、カラムの列です。
例えば、4月を入力したら、その月の値はこれで取得できました。
row( “4月” ).tostring.equals( “yourvalue”)
しかし、4月の関連データ(Column1,Column2,Column3,Column4,Column5)も取得したいです。
そのため、row( “4月” )のindexを取得したいです。

4月,Column1,Column2,Column3,Column4,Column5,5月,Column6,Column7,Column8,Column9,Column10,6月,Column11,Column12,Column13,Column14,Column15,7月,Column16,Column17,Column18,Column19,Column20,8月,Column21,Column22,Column23,Column24,Column25,9月,Column26,Column27,Column28,Column29,Column30,10月,Column31,Column32,Column33,Column34,Column35,11月,Column36,Column37,Column38,Column39,Column40,12月,Column41,Column42,Column43,Column44,Column45,1月,Column46,Column47,Column48,Column49,Column50,2月,Column51,Column52,Column53,Column54,Column55,3月,Column56,Column57,Column58

Hi, I got it.
I use DataTable.cloumns.indexof, to get indexOf.
Thank you!

1 Like

Great
Cheers @rena168