列を一括で同じ数値に変更したい

こんにちは。

データテーブルの列の値を条件に一致する場合は、そのまま保持。
一致しない場合は、データテーブルの列のすべての値を"0"に変更したいです。

ロボットの負荷を軽くするために、繰り返し(各行)以外で設定する方法はありますでしょうか?
方法があれば教えていただきたくよろしくお願いいたします。

Hi @nana.o

Try like this

I hope it helps!!

1 Like

こんにちは

たとえばInoveCodeアクティビティ内でLINQをつかって処理します。
以下は0列目の5未満を0にしています。

dt.AsEnumerable.Where(Function(r) CInt(r(0))<5).ToList().ForEach(Sub(r)
    r(0)=0
End Sub
)

image

Sample20230724-3L.zip (2.8 KB)

1 Like

@nana.o

1 Like

Hi @nana.o

Use for each row in datatable activity to iterate the each row of datatable.
Inside for each take the If condition and write the condition
Currenrow(“Column name”)=(“Value”)
In else block take an assign activity in Save to field → Currentrow(“Column name to update”)
in value field → “0”

It will check the every row with the condition if condition is passed then it will update that column.

Check the below image for better understanding.

Output -
image

Hope it helps!!

1 Like

Thank you @nana.o

If you find the solution Make mark it as solution to close the loop.

Happy Automation!!

ありがとうございます。
こちらの方法で解決することができました。

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.