Error in Try and Catch

Hello,

I have to use a filter on a dataTable, sometimes works with string, some other with Int, so search both with an “or”.

If i try to convert something that cannot be converted (e.g “C1 943657”) the filter gives me errore

What i’m trying to do:

Try Catch to convert a string into Int32

If you can’t, don’t try to convert the string

What’s the issue:

The Try Catch give me an exception when evaluating the Try Stage:

The exception is:

Try Catch: Input string was not in a correct format.

Any suggestion?

Thanks

Hey @Gabriele_Camilli :wave:

I suppose you are getting the error because you’re using Try Catch? Kindly run the workflow instead of debugging and let me know if you are facing any issues!

@Gabriele_Camilli:
It seems you are using the code in the debug mode. please directly run the code.

Else follow below aproach then you wont need the trycatch

  • Take Assign : in value use: IF(variable1.isnumeric,Cint(variable1),variable1)

@monsieurrahul and @MuralidharVankamaddi,

When i try to run it i get the following errore:

@MuralidharVankamaddi is numeric works on string?

Thank you both

The second method worked,
thank you @MuralidharVankamaddi

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