Inside system property i want to get user's firstname
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2024 04:11 AM
Hi Team it's urgent!
I want to get user's first name inside system property , there is a system property called as com.glide.cs.general.closing_message inside this i want to get user's first name

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2024 04:29 AM
@snow34 You will not be able to fetch user's first name inside the system property. Try to see in which script include/business rule this property is used and add the user's first name using a string concatenation.
For e.g.
gs.info(gs.getProperty(com.glide.cs.general.closing_message) +gs.getUser().getFirstName());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2024 04:58 AM
Hi @snow34,
You could try this below script
// Get the closing message system property value var closingMessage = gs.getProperty('com.glide.cs.general.closing_message'); // Check if the closing message contains the user's first name if (closingMessage) { // Assuming the first name is separated by a specific character, such as a comma or colon var firstNameArray = closingMessage.split(':'); // Change ':' to the appropriate separator var firstName = firstNameArray[0].trim(); // Assuming the first name is before the separator and needs trimming // Now you can use the extracted first name as needed gs.info('User\'s first name: ' + firstName); } else { gs.error('Closing message system property is empty'); }
Please accept my solution if it resolves your issue or thumps up.
Thanks
Jitendra

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2024 09:01 AM
Hi there,
Didn't you already have a topic open for this? Just follow-up there.
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field