Read date/text from excel cells as strings

How would i read a cell in excel that would either have normal text or a date inputted in it and assign the cell value to a string variable

@UiUser

Use Read Cell activity to read the data from specific cell and it will give you output as String.

@lakshman

When I use Read Cell and the cell in excel contains a date it gives a error
The cell type says “Date” it has an error and when it read “text” it is fine, but i would like for it to work either way

@UiUser

Could you show me screenshot of that data in Excel cell and also show me how you are reading it ?

@lakshman
Here is the picture of the cell data image

and here is the error that occurs when this cell is read image

Here is the read activity and the variable cell_data is a string type: image

maybe look into the variable type you are using to store the read cell, make sure it is GenericValue.

2 Likes

Yah
Kindly change the type of variable in READ CELL ACTIVITY from string to generic value UiPath.core.GenericValue

Cheers @UiUser

1 Like

Thank you both this solution worked better

1 Like

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