- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I am embarrassed to ask this question.
I am on lesson 15 of Chuck Tomasi Learn JavaScript on the Now Platform. Trying to work Lab 4. I have a PDI.
My problem is that I don't know what Navigator App or Module to select in order to start writing the simple JavaScript such as the below:
Any help appreciated
// Lab 4:
// Create a script that takes a string variable "Hello world"
// and translates it to at least 3 different languages
// based on a 'language' variable.
// Make the default language English if a match isn't found.
var language = 'German';
var fromString = 'Hello world';
var toString = '';
switch (language) {
case 'German':
toString = 'Hallo Welt';
break;
case 'French':
toString = 'Bonjour le monde';
break;
case 'Spanish':
toString = 'Hola Mundo';
break;
default:
toString = 'Hello, world';
}
gs.info(fromString + ' in ' + language + ' ==> ' + toString);
StacyLen
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi StacyLen,
You can run this using 'Fix Scripts' or 'Scripts - Background' in the left nav. Other examples in this video series will use Business Rules, Script Includes, Client Scripts, or scripted REST API. He will direct you in the videos when to use each of these.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi StacyLen,
You can run this using 'Fix Scripts' or 'Scripts - Background' in the left nav. Other examples in this video series will use Business Rules, Script Includes, Client Scripts, or scripted REST API. He will direct you in the videos when to use each of these.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @StacyLen ,
You can also try "ServiceNow snd_xplore.do" as well. Xplore is used to improve development activities and support for instances.
Please mark helpful if it helps.
Thanks,
Aparna
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @StacyLen
Click on ALL and open your Application Navigator --> Write sys.scripts.modern.DO and Hit Enter
And paste your script there.
Happy to help!
To help others in the community find this solution, kindly mark this response as the Correct Answer and Helpful.
Warm Regards,
Deepak Sharma
Community Rising Star 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @StacyLen ,
Please navigate to All< System Definition < Script - background
Paste your code and run it
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
