Is there any function available to check if variable value is "User" or "group"?

Certified Lead Developer
Hi,
I have a variable "assignee" of "User or Group" type. I want to know if user enter "User" or "group" as an input for this variable. Is there any function available to check if variable value is "User" or "group"?

OriginalPostID-271256

  Discussion posts and replies are publicly visible

Parents
  • AFAIK there is no in-built function to verify weather it is a user or group.
    I think you can make a use of typeof() function to check this. This function return integer value for the type.
    Suppose,
    if variable is of type "User" then it will return = 4
    If variable is of type "Group" then it will return = 5
    If variable is of type "User or Group" then it will return = 27

    Let us know if that works for you.
Reply
  • AFAIK there is no in-built function to verify weather it is a user or group.
    I think you can make a use of typeof() function to check this. This function return integer value for the type.
    Suppose,
    if variable is of type "User" then it will return = 4
    If variable is of type "Group" then it will return = 5
    If variable is of type "User or Group" then it will return = 27

    Let us know if that works for you.
Children
No Data