Issue with Data Table's Look up Activity

Hi experts,

I have a question about lookup activity in Studio. I tried to use it and understand the activity’s requirement in UiPath documentation and my understanding with Excel Vlookup. However, I have found issues with the Lookup activity’s property setting.

For example:

I want to update a data table with a new value:

Sample of data table dtClientInvoice


| ClientName | InvoiceTotal |
| Anthony | 100 |
| Steve | 0 |
| Emma | 50 |

I’m using data table for each to update the value under InvoiceTotal from another data table.
If I want to update Steve’s InvoiceTotal, how should I define it in Lookup activity properties?

image

I put “ClientName” as Column Name value. Why I get this error?

Lookup Data Table “InvoiceTotal”: In the ‘Target Column category’ the value for argument ‘Column Name’ is not set or is invalid.

Thank you.

Hello @D_Okthree

Lookup:

  • Column Name: “ClientName”
  • Lookup Value: “Steve”
  • Target Data Table: dtClientInvoice
  • Target Column Name: “InvoiceTotal”
  • Output: (Optional) store the found value in a variable

Thanks & Cheers!!!

Hi @D_Okthree

Try to give column number instead of column name if it’s default.

Hi @Kartheek_Battu ,

I am exactly doing that. However, as I mentioned before, the error message said that putting “ClientName” in Column Name was invalid, although that exactly the name of the column.

Lookup Data Table “InvoiceTotal”: In the ‘Target Column category’ the value for argument ‘Column Name’ is not set or is invalid.

@D_Okthree

  1. Ensure correct case sensitivity in the column name.
  2. Confirm that the DataTable is loaded correctly.
  3. Verify there are no extra spaces or characters in the “Column Name” property.
  4. Check variable scope and activity placement.
  5. Ensure compatibility with your UiPath version.

@Kartheek_Battu ,

I have made sure that:

  1. Column name
    image

  2. And I set the value accordingly

image

Then why I still get the same error message:

Lookup Data Table “InvoiceTotal”: In the ‘Target Column category’ the value for argument ‘Column Name’ is not set or is invalid.

Thank you.

@D_Okthree

Initialize your DataTable (replace this with your actual DataTable)
Dim dataTable As DataTable = New DataTable()

Add data to your DataTable (replace this with your data)
dataTable.Columns.Add(“ClientName”, GetType(String))
dataTable.Columns.Add(“InvoiceTotal”, GetType(Double))

Populate your DataTable with data (replace this with your data)
dataTable.Rows.Add(“Anthony”, 100.0)
dataTable.Rows.Add(“Steve”, 0.0)
dataTable.Rows.Add(“Emma”, 50.0)

Specify the value to search for in the ‘ColumnName’ variable
Dim columnName As String = “ClientName”
Dim searchValue As String = “Steve”

Use the Lookup Data Table activity
Dim result As Object = dataTable.AsEnumerable().Where(Function(row) row(columnName).ToString() = searchValue).FirstOrDefault()

Check if a matching row was found
If the result IsNot Nothing Then
Get the value from the ‘InvoiceTotal’ column in the matching row
Dim invoiceTotal As Double = Convert.ToDouble(DirectCast(result, DataRow)(1))

Do something with the invoiceTotal value (e.g., log or use it)
Console.WriteLine("Invoice Total for Steve: " & invoiceTotal)

Else
Handle the case when no matching row is found
Console.WriteLine(“No matching row found for Steve.”)
End If