Should be simple, but can’t get it to work! I have loaded an Excel sheet into a data table in Studio with Use Excel File and Read Range. I want to search for a given value in column A and retrieve the value of the cell in the matching Column B, using Lookup Data Table. In the Read Range method, I ticked the Has Header box. Unfortunately the Lookup fails with:
05/12/2022 16:52:29 RemoteException wrapping System.ArgumentException: In the ‘Lookup Column category’ the value for argument ‘Column Name’ is not set or is invalid.
But I can’t for the life of me figure out what the Column Name should be. I have tried both the name in the header, using quotes (“Staff number”), and just “A” as it’s column A, but same error. Any idea?
Set a breakpoint on the activity after the Read Range. Run in Debug mode. When it stops, look in the debug panels and you can see the datatable variable and expand it to see all the column names and other properties.
Thanks Paul! Once I figured out I had to add the data table variable to the watch list (I am very new to UIPath), I could see the column names. For some reason, they are Column1, Column2, etc. Which means I no longer get an exception, but a bit surprised that the actual column names were not imported by Read Range since I had ticked Has Headers?
I did set the column name in that Property, but turns out the constructed data table is using Column1, Column2, etc instead of the actual column names. Not sure why!