UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21. Read more.
UPDATE! The community will be go into read-only on April 19, 8am Pacific in preparation for migration on April 21.Read more.
Cadet 3rd Class
Cadet 3rd Class
600 views

UFT importing incorrect data from Excel - Showing [] in Vlookup

Hi,

I'm importing some data from excel to UFT Datasheet. There are some Vlookups in my data and they work fine in excel, however post importing it UFT is adding "[]" as a prefix to the array of the function showing below.

=VLOOKUP(A2,Customer!$A$1:$C$100,3,0)

to

=VLOOKUP(A1,[]Customer!$A$1:$C$99,3,0)

Now, as you can see it has added [] before Customer which is failing the function. 

Thanks!

 

Labels (4)
Tags (4)
0 Likes
1 Reply
Lieutenant
Lieutenant

Hi,

I have not encountered this myself so unfortunately I'm not able to provide you an actual fix for this. Might be something to do with Excel formatting as I believe that UFT datatables are not completely compatible with everything in the .xlsx file formats.

Anyway, as a workaround you should be able to use Replace() function after importing the data.

DataTable.Value("fieldName", "sheetName") = Replace(DataTable.Value("fieldName", "sheetName"), "[]", "")

In many cases though it might be best idea (personal opinion) not to have too much functions in the datatable but rather make the calculations in script where possible.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.