Forum Discussion

saivina2920's avatar
saivina2920
Icon for Post Prodigy rankPost Prodigy
4 years ago
Solved

How to split specific character from Widows AD Name

I want to display Active Directory user name in my dashboard using label or textbox.

How to get current AD name and display in label or textbox...?

For Example my current Windows AD name would be "ccnet\joseph"

 

I want to display in my label as Hi "Jospeh" would be the final name to be displayed in label or textbox..

 

How to split only name from my current AD name...?

 

  • PC2790's avatar
    PC2790
    4 years ago

    Here you go:

     

    UNam =
    VAR Finddelimiter =
    FIND ( "@", USERPRINCIPALNAME (), 1 )
    VAR DomainName =
    MID ( USERPRINCIPALNAME (), 1, Finddelimiter - 1 )
    VAR FindDelimiterDot =
    FIND ( ".", DomainName, 1 )
    VAR FirstName =
    MID ( DomainName, 1, FindDelimiterDot - 1 )
    VAR LastNameInitial =
    MID ( DomainName, FindDelimiterDot + 1, 1 )
    RETURN
    UPPER ( LEFT ( FirstName, 1 ) )
    & RIGHT ( FirstName, LEN ( FirstName ) - 1 ) & " "
    & UPPER ( LastNameInitial )

11 Replies

  • PC2790's avatar
    PC2790
    Icon for Community Champion rankCommunity Champion

    If you have your Windows AD Name in any column then you can try to create a new calculated column like this:

     

    UName = RIGHT(Table[Column1],FIND("\",Table[Column1],1,LEN(Table[Column1])))
     
    Result will be like:

     

    • saivina2920's avatar
      saivina2920
      Icon for Post Prodigy rankPost Prodigy

      Thanks for your quick response.

       

      Is it possible to directly read from windows AD name and split it.?