How to fetch username out of Email address

Hi fellow devs,

There is a scenario where I have email address available to me like: "testuser@gmail.com" and this email address has some username at the backend like this: "Test_user".

Now what I want to do is on the basis of email I want to fetch username. Previously I was using this function to fetch username out of email address:

index(getusersby(pv!ccperson,3,1),1, null)

(this function gives output in expression rule but in process model don't know why its not working and gives error)

but now it seems like this function is no longer working. I am unable to find any other function through which I can perform this functionality, any help in this regard would be helpful.

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    Hi  ,

    Yes, you can use the user() function by passing the email ID as an argument. This will allow you to retrieve first name, middle name, last name, display name (the user's nickname), supervisor name, title, email, office phone, mobile phone, home phone, address lines 1-3, city, state, province, zip code, country, locale, time zone, custom fields 1-10, UUID, creation date, status, user type ID, and user type name. However, please note that the exact username cannot be retrieved using this function. Regarding the getUsersBy() function, I am unable to obtain the expected output while using this function am also looking for the solution.

Reply
  • 0
    Certified Associate Developer

    Hi  ,

    Yes, you can use the user() function by passing the email ID as an argument. This will allow you to retrieve first name, middle name, last name, display name (the user's nickname), supervisor name, title, email, office phone, mobile phone, home phone, address lines 1-3, city, state, province, zip code, country, locale, time zone, custom fields 1-10, UUID, creation date, status, user type ID, and user type name. However, please note that the exact username cannot be retrieved using this function. Regarding the getUsersBy() function, I am unable to obtain the expected output while using this function am also looking for the solution.

Children
No Data