# Extract first user from a user list

• 0
• Question
• Updated 2 years ago
I have a UserList field with a unknown number of users. Is it possible to extract the first user only? Bonus: is it possible to count the number of users in list field?
• 400 Points

Posted 2 years ago

• 0
• 1,512 Points
Show first user from a list-user field:
`ToUser(Part(ToText([User List]),1,";"))`
Count users in a list-user field (this handles up to 10):
`If(not IsNull(ToUser(Part(ToText([User List]),10,";"))), 10,not IsNull(ToUser(Part(ToText([User List]),9,";"))), 9,not IsNull(ToUser(Part(ToText([User List]),8,";"))), 8,not IsNull(ToUser(Part(ToText([User List]),7,";"))), 7,not IsNull(ToUser(Part(ToText([User List]),6,";"))), 6,not IsNull(ToUser(Part(ToText([User List]),5,";"))), 5,not IsNull(ToUser(Part(ToText([User List]),4,";"))), 4,not IsNull(ToUser(Part(ToText([User List]),3,";"))), 3,not IsNull(ToUser(Part(ToText([User List]),2,";"))), 2,not IsNull(ToUser(Part(ToText([User List]),1,";"))), 1)`
(Edited)
• 31,698 Points
Once the record is saved the user list is alphabetized so showing the first will always be the first in the list from A-Z.
• 1,512 Points
Ahh, good point. Jonathan, can you clarify what you're trying to do here?
• 400 Points
Hmm, I never realized the post-save alphabetization! Thanks for pointing that out Matthew. I believe this will invalidate the question, as I'd assumed that the order the users were put together would be retained, but appreciate the responses, Dan.