How to check whether the username is valid or not?

Certified Associate Developer

Hello,

Is there a way to check whether the user name is valid or invalid?

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    You can use isusernametaken function.

     

    As the above function is case-sensitive, below expression helps to find the case-insensitive,

    if(
      isusernametaken(
        ri!user
      ),
      true,
      or(
        a!forEach(
          items: getallusers(
            1,
            - 1
          ),
          expression: lower(
            ri!user
          ) = lower(
            fv!item
          )
        )
      )
    )

     

    Also. there is one more function isuseractive() to check whether the user is active.

     

    Function- getAllUsers() is custom function available as part of People Functions Plugin.

Reply
  • 0
    Certified Lead Developer

    You can use isusernametaken function.

     

    As the above function is case-sensitive, below expression helps to find the case-insensitive,

    if(
      isusernametaken(
        ri!user
      ),
      true,
      or(
        a!forEach(
          items: getallusers(
            1,
            - 1
          ),
          expression: lower(
            ri!user
          ) = lower(
            fv!item
          )
        )
      )
    )

     

    Also. there is one more function isuseractive() to check whether the user is active.

     

    Function- getAllUsers() is custom function available as part of People Functions Plugin.

Children
No Data