Hi everyone,
I'm trying to get the active users on a table but I'm able to get only their usernames with a for loop and getSessionInfo() function. I can read the full name (First and Last name) in the Test Login/Mapped User Attributes.
How can I get their full names instead of usernames on the table?
You can call out to system.user.getUser() to gather that information
sessionInfo = system.perspective.getSessionInfo(projectFilter="YourProjectNameHere")
for index, sessionObj in enumerate(sessionInfo):
uInfo = system.user.getUser('', sessionObj["username"])
system.perspective.print(uInfo.get('lastname'))
system.perspective.print(uInfo.get('firstname'))
MMaynard:
sessionInfo = system.perspective.getSessionInfo(projectFilter="YourProjectNameHere")
for index, sessionObj in enumerate(sessionInfo):
uInfo = system.user.getUser('', sessionObj["username"])
system.perspective.print(uInfo.get('lastname'))
system.perspective.print(uInfo.get('firstname'))
Hi MMaynard,
I'm getting this error:
I'm using OKTA Authentication
Authentication providers shouldn't change this data, the user sessions should be stored the same way regardless of IdP.
MMaynard:
system.user.getUser(
This only works with user sources, not with Identity Providers.