Assign : String cannot be of zero length. Parameter name: oldValue excel

i am trying to split names in a excel sheet. so I can have a message box display only the first name or last name. i am able to do that but then i get a error saying the parameter s cannot be zero when there is a empty cell. What I’m trying to accomplish is to input something into a message box and have the activity stop once there’s an empty cell. after that it will go into a website and perform other activities. so how can i stop this error from happening so the rest of my workflow can work.

1 Like

Hey @Shazid_Rahman

I hope you are trying to loop the excel data table as rows.

So you need to have a check here with an IF statement to break the loop whenever the value is empty.

Condition will be something like below,

String.IsNullOrEmpty(Convert.ToString(your_var))

Else sequence → Just do the split logic

Then sequence → Just break the loop using Break activity

There are many other ways to do this, but the above is a pretty straight forward way. If any of my understanding is wrong from the above please excuse and let me know

Hope this helps

Thanks
#nK

i tried that but the if statement is not working.

1 Like

can you show me a workflow or anything

1 Like

everytime i run the if activity with the break. it just breaks, and anything else. but it suppose to go through the names and then break when there is empty cell
.

1 Like

Hey @Shazid_Rahman

Please find the below…

Hope this helps

Thanks
#nK

1 Like

this is what im doing and its not working it just breaks right away

1 Like

Hey @Shazid_Rahman

Ok which means the first row you are receiving here is itself empty.

Thanks
#nK