Inside system property i want to get user's firstname

snow34
Tera Contributor

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

snow34_0-1716721848124.png

 

3 REPLIES 3

Sandeep Rajput
Tera Patron
Tera Patron

@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());

Jitendra Diwak1
Kilo Sage

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 

Please accept my solution if it works for and thumps up.

Mark Roethof
Tera Patron
Tera Patron

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

LinkedIn