Sim Task #7 - BR and Script Include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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.
I see the output too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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 .