← servoy magazine

[Tip] How to create a users valuelist

  • Tips

by Enrico Arata (automazione)

Two lines of code and a valuelist with the users defined in your server will be ready for use on a combo-box:

just define an empty value list with name: users_list.

and then:

var server_users = security.getUsers()
application.setValueListItems('users_list', server_users.getColumnAsArray(2), server_users.getColumnAsArray(1))

will load the value list with the user names and user_id key, ready to use on a combo-box integer field.


bye

Enrico