Getting an error like input string not in correct format

Hello Everyone,

This is my INPUT Excel file

I am Trying to get an OUTPUT like this
OUTPUT

while debugging i am getting an error like “Input string not in correct format”, can any one help me how to get out of this error

here i am uploading the files
PROJECT_1.xaml (10.5 KB)

SSBI.xlsx (18.9 KB)

Hi,

There are 2 reasons as the following.

First, some cells are whitespace. It fails in Convert.ToInt32
Second, there are non-integer value like 331.01.

So, can you try the following condition in If activity?

not String.IsNullOrWhiteSpace(row(4).ToString()) AndAlso Convert.ToDouble(Row(4).ToString())>=1000.00

Regards,

2 Likes

Hi @adarsh_kotagiri
check this updated workflow
PROJECT_1.xaml (11.9 KB)

1 Like

Thank you sir its really working but one problem is that instead of getting an amount like 2650.26 i am getting 2650. How can i fix this

Thank you sir for taking time and giving the solution its working but i need a value like 2650.26 instead of 2650 how to do that

@adarsh_kotagiri

Try to enable PreserveFormat option from properties

Hope this may help you

Thanks

1 Like

Thanks but when i tick the preserve format the column one is changing but column two not even changing it remains the same , here it is

Result

Hi,

Can you try to change ArrayRow property as the following?

{Row(0),Math.Round(Convert.ToDouble(Row(4).ToString()))}

or

{Row(0),Math.Floor(Convert.ToDouble(Row(4).ToString()))}

PROJECT_1.xaml (10.6 KB)

Regards,

sorry sir but i don’t need round off values i need decimal values like 2650.26

Hi,

Sorry, I had misunderstanding.
It’s because DEBIT AMOUNT column is set as Int32 type in Build DataTable activity.
So, can you try to modify Int32 to Double in it?

Regards,

1 Like

Good catch , Thanks a lot sir its working

1 Like

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