Hi, i am trying to fetch user/group name from a group name constant which c

Hi,
i am trying to fetch user/group name from a group name constant which can accept multiple values .On trying to fetching using the index number , i am just getting the first name , it is not reading the space . Could anybody help me with this ? ...

OriginalPostID-79888

OriginalPostID-79888

  Discussion posts and replies are publicly visible

Parents
  • Hi Himanshu,

    First you need to find whether the value at an index is a group or user
    To do this use runtimetypeof() function. It will return 4 if value is user and 5 if value is group.
    Or you can use typename(runtimetypeof(XYZ[i])) which will return 'User' or 'Group' based on value.
    If returned value is user then use user() function to fetch properties like "firstName" , "lastName"
    else value would be group.

    Note: use toUser() and toGroup() to convert.
Reply
  • Hi Himanshu,

    First you need to find whether the value at an index is a group or user
    To do this use runtimetypeof() function. It will return 4 if value is user and 5 if value is group.
    Or you can use typename(runtimetypeof(XYZ[i])) which will return 'User' or 'Group' based on value.
    If returned value is user then use user() function to fetch properties like "firstName" , "lastName"
    else value would be group.

    Note: use toUser() and toGroup() to convert.
Children
No Data