- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2024 09:28 PM
how to populate loggedin user name in servicenow workspace.
don't have any idea about workspace.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2024 10:01 PM
Hi @shrngikaG ,
I tried your problem in my PDI and it works for me please check below solution
1. Create client script and add below code
function handler({
api,
event,
helpers,
imports
}) {
var name = api.context.session.user.fullName;
api.setState('loggedInuser', name);
}
2. Create client state parameter
3. Add this client state parameter to stylized text or where ever you want to show the current user name
Result
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-30-2024 10:03 PM
Hi @shrngikaG ,
I tried your problem in my PDI and it works for me please check below solution
1. Create client script and add below code
function handler({ api, event, helpers, imports }) { var name = api.context.session.user.fullName; api.setState('loggedInuser', name); }
2. Create client state parameter
3. Add this client state parameter to stylized text or where ever you want to show the current user name
Result
Please mark my answer correct and helpful if this works for you
Thanks and Regards
Sarthak