I AM UNABLE TO SAVE THE BELOW CODE DUE RED LINE ERROR

mani55
Tera Contributor

I AM UNABLE TO SAVE THE BELOW CODE DUE RED LINE ERROR  LET ME KNOW MY MISTAKE

 

 

mani55_1-1754396253702.png

 

6 REPLIES 6

Sandeep Rajput
Tera Patron
Tera Patron

@mani55 In your code you are using an else block without having a corresponding If statement. either remove the else block or use an if block to resolve this error.

 

Hope this helps.

Nilesh Pol
Tera Guru

@mani55 Make sure every 'if' block is properly wrapped in curly braces {} and closed it correctly before the else, we can see else is in if condition only it should be after closing the if condition.

 

if my response helps, please hit helpful and accept as a solution.

Nikhil Bajaj9
Giga Sage

Hi @mani55 ,

 

You are using else block  without any if Block that is the reason you are getting error.

 

Regards,

Nikhil Bajaj

Please appreciate my efforts, help and support extended to you by clicking on – “Accept as Solution”; button under my answer. It will motivate me to help others as well.
Regards,
Nikhil Bajaj

Ankur Bawiskar
Tera Patron
Tera Patron

@mani55 

ELSE without an IF will throw an error.

share your complete script here

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader