Please suggest me the function which will be helpful to convert uuid of user to user name. I am currently using Appian 20.2. As I have seen in the older version there is a function but now that is not available.
Discussion posts and replies are publicly visible
What do you mean with "uuid of user"? Where does this uuid come from? What do you want to achieve?
It depends on exactly what you're trying to achieve, and how many Users you are expecting to have in your environment. One option would be to generate a list of all of the Users in your environment and, for each, generate the UUID, and then you can conduct a look-up using the UUID you want to convert.
You can generate the list of Users using a!groupMembers().- not this is limited to a maximum of 10k results which is why I've said it depends on the number of expected User accounts in your environment. It also performs poorly at large volumes, so that would determine if this is a suitable option for the context you want to use it in.
You can generate the UUID for each using fn!getUserUUID() - you'll need to use the People Functions plug-in to get access to this function.
Once you have a list of correlating Users and UUIDs you can use the fn!displayvalue() to conduct the necessary look-up.
While accessing site usage logs csv we have got User details having UUID. So while displaying in the interface instead of showing as UUID we want to show User Names but not able to find function which can convert UUID to user name. Please provide any suggestion
Thanks of the reply. In Appian where we have fn!getUserUUID() which is used to get UUID of a given user but we require a function for converting UUID input to user as output, Is there function for this functionality?.
And I agreed with you for creating separate table for maintaining User details with their UUID values but we are trying looking if any function in Appian for converting UUID to user. Please suggest if any.
Thanks.
Again, depends on the precise requirements but if you don't need a 'real time' view of the log content you could run a process to regularly load the log content to a database table, and you can use the method described in my other reply to convert the UUIDs to User Names, also in the same table. Then it would just be a case of exposing that table to the front end.
You can use user("user","UUID") function in loop and pass all users you have in loop and check for the UUID you are searching for.
You can use User Record as below to get the username from user UUID:
a!queryRecordType(recordType: 'recordType!{SYSTEM_RECORD_TYPE_USER}User', fields: 'recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_displayName}displayName', filters:{ a!queryFilter(field: 'recordType!{SYSTEM_RECORD_TYPE_USER}User.fields.{SYSTEM_RECORD_TYPE_USER_FIELD_uuid}uuid', operator: "=", value: "XXXX")},pagingInfo: a!pagingInfo(1,1)
)