Wednesday, July 18, 2012

Removing Domain name from User ID

Referred URL

http://sharepoint.stackexchange.com/questions/36240/infopaths-built-in-username-function-returning-i0-wdomain-username-inste

How can I modify the UserName() return string to display only the username as opposed to "i:0#.w|Domain\UserName"?

Use the Substring function

substring-before
Returns a specific part of a text string. The first argument defines the text string, and the second argument defines what to look for in the text string. The function returns the text that precedes the first occurrence of the second argument.

substring-before(“SP/testuser1”, "\")

No comments: