Control Flow - Switch Activity - String Expression throws error

Hi Friends,

In Control Flow Topic , while using Switch Activity - String Expression throws error as “Length cannot be less than zero” . I have given the expression as per the academy demo video suggestion. Kindly find Screenshot below. Please help in fixing this error.

we would recommend to debug the flow and inspect the variable values. Maybe the value of the FileName variable is empty.

Additional we would also recommend to use variable names different to keywords or classnames. In your case File variable name is the same as the class File

1 Like

Hi,

This error shows length of File.Name is less than 4.
Can you check content of File.Name, for now?

Regards,

1 Like

Hi @Sri_Vennila check the syntax of substring:

It should be like(provide the start index)
strVar.Substring(0, strVar.Length-4)

1 Like

sure I will check on this. Thankyou :slight_smile:

Sorry nothing works. Am still checking for resolution.