How to extract date from a pdf file and load that into a data table(which is Created with build activity with a datatype column as DateTime) by using GetAttribute Activity


#1

How to extract date from a pdf file and load that into a data table(which is Created with build activity with a datatype column as DateTime) by using GetAttribute Activity.

It is giving me : Get attribute ‘XXXXX’ : String was not recognized as a valid DateTime.Couldn’t store <30/04/2018> in Column. Expected type is DateTime.


#2

hi @dheeraj_reddy97

Steps
1.Use Read PDF text with OCR and store it in a string variable
2.Based on the string variable you can use substring
3.Use Build Data Table
4.Add Data row

Thanks
Ashwin S


#3

Hi Ashwin,

Thanks for your inputs.

But the date is not a plain text in the PDF it is a Field.
image

so I’m using GetAttribute property to extract the date from that field.

Please note that the destination where I need to save is in a DataTable that has Column with datatype as DateTime.

I tried using the GetAttribute Property with Attribute as “Date” and “DateTime”.
It is not working and I’m getting error as :
Message: Attribute not supported by the current UiNode.

So I have used Get Attribute with Attribute as “Text” and now I’m getting error as : Get attribute ‘XXXXX’ : String was not recognized as a valid DateTime.Couldn’t store <30/04/2018> in Column. Expected type is DateTime.

I need the GetAttribute activity to sucessfully extract the date from the pdf fileld and save that to a datatable cell that has column with datatype as DATETIME


#4

hi @dheeraj_reddy97

In Get Attribute activity what property have you used?

Thanks
Ashwin S


#5

That is what I’m exactly looking for. Currentlly tried with “text” and “datetime”.
It is not working.

Kindly suggest me which Attribute we need to use.


#6

hi @dheeraj_reddy97

use aaname or title

Thanks
Ashwin S


#7

I’m getting the below Error Message:

Message: String was not recognized as a valid DateTime.Couldn’t store <> in A_GST_Registration_Date Column. Expected type is DateTime.


#8

hi @dheeraj_reddy97

Check the scrapped value and print the value in the message box

the error is trying to say the string is shown as null

you have print the value directly in dt

Check it and let us know

Thanks
Ashwin S