Sim Task #7 - BR and Script Include

Alekhya_Pasa
Giga Contributor

I am trying to validate my task on Scripting in ServiceNow Primer course Task#7. I did validate my code as per guide many time but I don't see any issues but when I click on "Validate task" it says validation failed.

Alekhya_Pasa_0-1793326191267.png

 

Alekhya_Pasa_1-1793326206360.png

 

Alekhya_Pasa_2-1793326231165.pngI see the output too.

2 REPLIES 2

Tejas Adhalrao
Mega Sage

hi @Alekhya_Pasa  ,

issue may be a small configuration or naming mismatch rather than a problem with your overall logic.

1) JavaScript is case-sensitive.

i can see in your code  - function logFormValues(str)

 

But your Business Rule appears to call:  LogFormValues(property + ", " + current[property]);

 

Notice the capital L in the Business Rule.

Make the names identical. I recommend using lowercase l .

 -->  logFormValues(property + ", " + current[property]);

 

2) Your logs show successful output, so I don't want you to keep changing working code unnecessarily.

just check the Business Rule's When to run tab.

 

 

If this helped, mark it helpful and accept the solution.

Regards,

Tejas

 

 

Tanushree Maiti
Tera Patron

Hi @Alekhya_Pasa 

 

Code seems to be OK.

 

In your script include API name , you have given a space . Remove it and try.

Update API name

from :  global. logFormValues

To :  global.logFormValues

 

 

Please Accept the solution if it assisted you with your question & Mark this response as Helpful.
Regards
Tanushree Maiti
ServiceNow Technical Architect
LinkedIn: https://www.linkedin.com/in/tanushreemaiti