OriginalPostID-203272
Discussion posts and replies are publicly visible
I'm assuming you already have the user UUID pulled from the log file that you want to find; I don't know if there's an in-system way to do this in particular. However I previously wrote the following functionality which finds the user belonging to the UUID you're looking for, here referred to as ri!findUUID:
with( local!allUsers: getdistinctusers(cons!GROUP_CONTAINING_ALL_USERS), local!allUUIDs: apply( fn!user( _, "uuid" ), local!allUsers ), local!lookupTable: joinarray( apply( fn!concat, merge( local!allUsers, repeat(length(local!allUsers), " - "), local!allUUIDs ) ), char(10) ), local!foundUser: index(local!allUsers, wherecontains(ri!findUUID, local!allUUIDs)), "Found: " & local!foundUser & char(10)&char(10) & "List:" & char(10) & local!lookupTable )
(EDIT: note that this trick should no longer be needed in at least the recent few versions, please see my newest response further down-thread from here).
Hi Mike, is this still the best way to retrieve a username from a user UUID?
No - for several versions now (i'm fuzzy on the particulars, but maybe since early in the 18.x versions), UUID search is incorporated directly into the search functionality of the new designer, for users as well as objects. In the Users tab, you can search on a UUID and the matching user will be returned. I just tested this in one of my 19.1 environments to confirm.
Is there any way to get user from UUID? Doesn't seem like there is OOB function to do so. Now that 20.1 allows updating username, instead of capturing username in the process/in DB for any purpose, capturing UUID and then using it seems logical. But there is need for a function to get user by UUID.