Skip to main content
Participating Frequently
January 12, 2021
Solved

How to get username/email/name from User object?

  • January 12, 2021
  • 6 replies
  • 1 view

Hi Team,

I am getting list of user or groups from a ER like below

Now I want to convert this User object to username/name or email.

Or easy language I want to fetch user details from this object 

Please help me

I tried user() but it gives parameter error maybe user() accepts username not user

Please Help

    Best answer by mikes0011

    assuming the "list of user or group" will usually only be 1 user long, and not a sub-list...  simply use a!forEach to loop over the entire list, and cast the internal result as a simple string before passing into the user() function, like this:

    a!forEach(local!data.c10,  user(tostring(fv!item), "firstName"))

    etc.

    6 replies

    mikes0011
    Brainy
    January 12, 2021

    user() is the function you want.  Can you post exactly the code you tried, and the exact error message you received?  Otherwise it's hard to provide help that isn't just blind guessing.

    The Expression Guru
    Participating Frequently
    January 12, 2021

    This is the list which is stored in c10 variable of process report

    I run

    user(local!data.c10[1][1],"firstName")

    and I got

    if I run

    local!data.c10[1][1]

    I get

    mikes0011
    mikes0011Answer
    Brainy
    January 12, 2021

    assuming the "list of user or group" will usually only be 1 user long, and not a sub-list...  simply use a!forEach to loop over the entire list, and cast the internal result as a simple string before passing into the user() function, like this:

    a!forEach(local!data.c10,  user(tostring(fv!item), "firstName"))

    etc.

    The Expression Guru