Thanks for the example, now it’s working… I’ve just modified the script in this way:
returns a datset of user names based on the user source and role filters
header = ['user']
opList = 
users = system.user.getUsers(source)
for user in users:
roles = user.getRoles()
if not 'Administrator' in roles and not 'Operatore' in roles:
username = user.get('username')
ds = system.dataset.toDataSet(header,opList)
In this way I show only roles that aren’t Administrator or Operatore, is correct as I modified or it should be done better?
Another question, I put the follow code to populate a dropdown when on in the visionWindowOpened of my login page
ds = users.getEmployees('default')
event.source.parent.getComponent('Dropdown').data = ds
the function works properly and it populate the dropdown, but ignition report the follow error:
File "<event:visionWindowOpened>", line 2, in <module>
TypeError: getComponent(): 1st arg can't be coerced to int
Where is the mistake?
Thank you very much guys!