Switch operations having some challenges


switch operation execution is having some challenges, can someone let me know the reason

@Narpavi_Manojprabhakaran

It looks like newfilename variable is empty due to that you are getting this error.

Hi @Narpavi_Manojprabhakaran

You need to give
newfilename = newpath3.split()

My Guess

Regards
Sudharsan

1 Like

Hello @Narpavi_Manojprabhakaran

Welcome to Uipath Forum.

The issue is occurring because you are trying to Assign a value to the variable newfilename from the same variable (which is already null) and so the error “object reference not set to Instance of an object”.

Kindly let us know about what you are trying to achieve in this use case. Thanks.

Jeshwanth

Try with this
That’s the issue

We are passing a object with null value that’s why error comes like Object reference as null

Cheers @Narpavi_Manojprabhakaran

HI @Narpavi_Manojprabhakaran,

This is happening because there is nothing there in newfilename variable. Please cross verify that you are using the right variable for splitting. Should it be newpath or may be you need to assign some value to newfilename variable before doing the split?

Also, By what character are you trying to do a split of string?

You will need to pass that char in the form of ASCII code under split function to be able to split successfully.

Like if you are trying to split by (,) then function would be something like below:
newfilename=newfilename.split(chr(44)) if you intend to initialize this newfilename before this command.
or
newfilename=newpath.split(chr(44)) if right variable to use here is newpath

Hope this helps.

Regards
Sonali