Invoke Code - VB Issue

Hi
I am using invoke code to loop around a datatable and update a specific column value from “Subject to revie” to “Subject to review”
I get syntax error at line 2. What could be the issue? I’m using VB . I pass the dt_Req as In/Out argument and it is a Datatable

For Each row As DataRow In dt_Req.Rows
If row(“Status”).ToString().Trim().ToLower() = “subject to revie” Then
row(“Status”) = “Subject to Review”
End If
Next

Hi @besakkiappan46

You should make sure that you set the argument as DataTable in the invoke code activity. You should not get any errors. If you still get errors, you should try closing UiPath Studio and reopening it.

I passed in the similar way only. I tried closing and Opening. No luck. Can you Share screenshot of your code? Just wanted to see if you are getting any Error.

I’ve just copy your code above. it was not occurring an error.

@besakkiappan46,

Make sure your code is following these points:

  1. Capitalization and Punctuation: Ensure every statement ends with a proper punctuation mark, including the main statement block indicators.
  2. Quotes and Case Sensitivity: Verify that the string comparisons are accurate in terms of quotes and casing.

Try this code:

For Each row As DataRow In dt_Req.Rows
    If row("Status").ToString().Trim().ToLower() = "subject to revie" Then
        row("Status") = "Subject to Review"
    End If
Next

Thanks. it worked. I restarted the studio. I don’t see that Error

2 Likes

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