How confident are you that the user in question has a defined first name and last name? When I ran this code I got some blank logging before realizing that the only users in that user source had no defined names. Once I switched the logging to only do usernames I found the info I expected.
Update:
After running this on a Gateway which has defined names for users I got al of the expected values:
11:07:29.322 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - None None
11:07:29.322 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Auth Proj
11:07:29.322 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Auth ProjG
11:07:29.322 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Auth ProjGR
11:07:29.322 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Auth ProjGRY
11:07:29.323 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Auth ProjGY
11:07:29.323 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Auth ProjR
11:07:29.324 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Auth ProjRY
11:07:29.324 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Auth ProjY
11:07:29.324 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Hoban Washburn
11:07:29.324 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Inara Sera
11:07:29.324 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Jayne Cobb
11:07:29.324 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Kaylee Frye
11:07:29.324 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Malcolm Reynolds
11:07:29.324 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - None None
11:07:29.325 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - None None
11:07:29.325 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Shepard Book
11:07:29.325 [Browser Thread: 58637] INFO Perspective.Designer.Workspace - Zoe Washburn
You should inspect what user source the PROJECT defaults to if you are still not seeing any logging. Where are you running the code (Designer/Session/Script Console)?
You are correct! So I am using the default user source and some of my users do not have names but they all have usernames so I used the script below:
Still did not get any logs
users = system.user.getUsers("")
for user in users:
system.perspective.print(user.get('username'))
Is there a difference in your environment between “default” and the default user source for the project? Verify that you are indeed using the correct identity provider by specifying the one you expect to see values in.
you could also improve the logging:
users = system.user.getUsers("")
system.perspective.print('Users found: {0}'.format(len(users)))
for user in users:
system.perspective.print('User: {0}'.format(user.get('username')))
So I’ve tried different user sources and identity providers.
None of them works. I get this error:
Error fetching users.
I tried your script too and get the same error.
I am trying this script on a button; however, eventually, I would like to bind a table’s data to the user data I get from the script just like the vision component.
Ah, yes, that's my fault. I often mix-up User Sources and Identity Providers for no reason. I meant to ask if there was a difference between the "default" user source and the user source specified as the default for the project. You should only be supplying User Source names to the getUsers function, and you should not be seeing that error when you do so. If you are encountering that error while supplying a valid user source, then something else is going on.
My script should NOT be causing that error (though it IS missing a right paren). Please double-check.
Thank you this is amazing. You can change the table selection style and add "borderStyle:none" to perhaps improve the look on the cell selection. Perhaps that's just preference.