- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
[Yokohama]
I've got a UI page in the global scope, and I'd really like to use optional chaining in the HTML evaluate tags.
Regardless whether that's supported, the toggle at the top of the form "Turn on ECMAScript 2021 (ES12) mode" always flips back to .false. after saving the form.
I've looked in the sys_es_latest_script table, and no records were updated. I manually created a record there for the UI page, but upon reloading it still is marked false.
Is this a known issue with UI pages? Is there a workaround?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Stephen W_ ,
It’s a known issue. Even though the docs say the Turn on ECMAScript 2021 (ES12) mode toggle should let you use optional chaining etc in UI Pages (global scope), it often doesn’t stick because of defects. ServiceNow has acknowledged this under KB1699139 and PRB1794568, and says the fix is targeted for Zurich....
As a workaround, If possible, move your code into a Script Include in a scoped app; toggle ES12 mode there where it tends to behave better....Test your ES2021 code (optional chaining, etc.) in script types known to work (script includes, business rules) rather than UI Pages until the fix is applied...
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Ecmascript 2021 support in the Global application was introduced somewhere around the Utah release, but is not operational until Zurich.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I thought this was supposed to be operational as of Xanadu, and despite some linter issues, it seems to be working.
Can you provide a source for the "operational in Zurich" statement? What exactly is being fixed?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
This KB pretty well summarizes the issues I've seen, but not just in Fix Scripts.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1699139 and there's a problem record PRB1794568.