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.

4 REPLIES 4

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

 

 

Ehab Pilloor
Giga Sage

@Alekhya_Pasa 

 

There is extra space in your Script include name and API name, that is mostly causing the issue.

 

If this response resolved your issue, please consider marking it as Helpful and accepting it as the Solution. Your feedback helps other ServiceNow Community members find reliable answers.

Kind Regards,

Ehab Pilloor

Aditya_hublikar
Giga Sage

Hello @Alekhya_Pasa ,

 

First remove whitespace and also check its case sensitivity then again validate it . If it not works then you delete that one create new one with proper name( that asked in validation) and ten call it in your BR .

 

 

If this helps you then mark it as helpful and accept as solution .

Regards,

Aditya .