How to replace Empty string Box value with 0

I Have column which looks like this

Screenshot (39)

I want my program to automatically take the value as 0 when it find an empty input box

PS - My input box is of number type

I tried but it returns an error as Input string was not in correct format

Any solutions willl be appreciated

Hi @Ishan_Shelke1 ,

Could you give this a try?

If(IsNothing(CurrentRow("Lock Qty")) OrElse String.IsNullOrEmpty(CurrentRow("Lock Qty").ToString), 0,CInt(CurrentRow("Lock Qty").ToString))

Kind Regards,
Ashwin A.K

1 Like

Didn’t get you Can you tell me what to put in the condition of if and wat should I put in else ?

Hi @Ishan_Shelke1 ,

If you are retrieving values from an InputBox, and storing it to an integer, then use this to achieve the operation in a single step →

yourVariable = If(IsNothing(yourVariable) OrElse String.IsNullOrEmpty(yourVariable.ToString), 0,yourVariable)

If you want to use an If Activity, then use this instead →

IsNothing(yourVariable) OrElse String.IsNullOrEmpty(yourVariable.ToString)

Then → 0
Else → yourVariable = yourVariable

Kind Regards,
Ashwin A.K

@Ishan_Shelke1 Is this column that you were representing is in web application

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