Row("Date")とitemの値を比較して同じ場合はThenに処理を渡す構文

こんばんは
UiPath Studio 2024.10.5Community editionのユーザです。

For Eachアクティビティで項目名itemでコレクションarr_1を回します。


arr_1 = string[4] { "2024/09/21", "2024/09/22", "2024/09/25", "2024/09/26" }

For Eachアクティビティの中でDataTable dt_1を項目名RowでForEachRowアクティビティで回します。

dt_1の値は下記のとおりです。

[Date,"Status""〇""AVG TimeSpan"
09/22/2024,00:01:45
09/26/2024,00:01:18
]

ForEachRowアクティビティの中に配置したElse Ifアクティビティの条件で、Row(“Date”)とitemの値を比較して同じ場合はThenに処理を渡したいのですが、

Else Ifアクティビティの条件文を
Row("Date").ToString = item
と書いたら、すべてElseに処理が流れてしまいました。

条件文を
Row.Field(Of DateTime)("Date").ToString("yyyy/MM/dd") = item
と書いたら、下記のエラーが出ました。
The image shows a runtime error message from UiPath indicating a type casting issue where a 'System.String' object could not be cast to 'System.DateTime', resulting in a System.InvalidCastException. (Captioned by AI)

Row(“Date”)とitemの値を比較して同じ場合にThenに処理を渡すことができる条件文の書き方をご教示ください。

@gorby

Try this

Cdate(Row("Date").ToString).ToString("yyyy/MM/dd") = item

Cheers

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