CSM Workspace Landing Page Variant – Syntax Error & Missing "Hello, User!" Message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
46m ago
Hi Community! 👋
My CSM Workspace Landing Page is throwing the following error on load:
"Syntax error: Expected end of expression but found ':' at position 10"
Also, the "Hello, User!" message is not displayed either.
I believe the cause is the Header 3 component's label script being missing but I'm not sure. This component is responsible for displaying the personalized greeting:
"Hello, {user first name}!"
Has anyone experienced this or knows the OOB script for this component? Any help is greatly appreciated! 🙏
My Landing page Header 3 label script:
OOB CSM Landing page header 3 script and data:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
35m ago
Hi @ManuelInn ,
Based on the screenshots, there are likely two separate issues:
1. The personalized greeting script on Header 3 is missing.
2. The "Expected end of expression but found ':'" message looks like a UI Builder expression/data-binding parsing error, not necessarily an error from the greeting JavaScript itself.
For the missing "Hello, User!" greeting, restore the OOB Header 3 Label script.
In UI Builder:
CSM/FSM Configurable Workspace
-> Landing Page
-> CSM Landing Page
-> Header Banner
-> Header 3
-> Label
-> Use script
Use the following OOB script shown in your working CSM Landing Page:
function evaluateProperty({
api,
helpers
}) {
var userGreetings;
var name = api.context.session.user.firstName;
var userLanguage = api.context.session.user.language.toLowerCase();
var honorificLanguageCodeArr = ["zh", "zh-ch", "zh-hk", "ja", "ja-jp"];
if (name && name.length > 0) {
if (honorificLanguageCodeArr.indexOf(userLanguage) > 0) {
name = api.context.session.user.lastName;
userGreetings = helpers.translateSync("Hello, {0}!", name);
} else {
userGreetings = helpers.translateSync("Hello, {0}!", name);
}
} else {
userGreetings = helpers.translateSync("Hey there!");
}
return userGreetings;
}
Save the page and Preview the variant again.
However, I would also check whether this started after an upgrade.
ServiceNow specifically documents that when upgrading CSM Configurable Workspace, customers who have customized the existing CSM Landing Page do not automatically receive the updated landing page. The updated landing page must be manually accepted.
Therefore, if this appeared after an Australia/Xanadu upgrade, I would recommend:
1. Open the current OOB CSM Landing Page variant.
2. Compare it with your customized variant.
3. Check whether the updated CSM Landing Page is waiting to be accepted after the upgrade.
4. Prefer creating a new variant from the current OOB landing page.
5. Reapply only your required customizations to the new variant.
This is safer than manually repairing multiple missing OOB component properties.
Regarding the syntax error:
"Expected end of expression but found ':' at position 10"
That message normally indicates that one of the UI Builder component properties contains an invalid expression/binding.
After restoring Header 3, if the error remains:
1. Preview the OOB CSM Landing Page.
If OOB works:
-> The issue is inside your custom variant.
2. Compare your custom variant component-by-component with OOB.
Pay particular attention to properties using:
- Data binding
- Formula
- Script
- @context
- @data
- @state
- @element
3. Look for a property that was changed from its OOB value or contains an expression with an unexpected ":" character.
Do not try to correct this through DOM manipulation or by editing protected UX records directly.
Also verify that you are testing the expected variant:
- Active = true
- Correct audience
- Correct conditions
- Correct order
A lower-order active variant can be selected instead of the variant you are editing.
My recommended approach would be:
First restore the Header 3 OOB Label script.
If the greeting returns but the syntax error remains:
-> Find the malformed binding separately.
If this followed an upgrade and several OOB properties are missing:
-> Accept/use the current OOB CSM Landing Page and recreate your customization as a page variant.
ServiceNow recommends creating a CSM Landing Page variant rather than modifying the provided landing page directly specifically to reduce upgrade issues.
Official references:
CSM Landing Page:
https://www.servicenow.com/docs/r/customer-service-management/csm-ws-landing-page-original.html
Create a CSM Configurable Workspace landing page:
https://www.servicenow.com/docs/r/customer-service-management/config-csm-config-ws-landing-page.html
Manage UI Builder pages and variants:
https://www.servicenow.com/docs/r/application-development/ui-builder/work-pages.html
Hope this helps!
If this response helped, please mark it as Helpful.
If it resolves your issue, please Accept it as Solution.
Kind Regards,
Abhishek Pal