{"id":186,"date":"2012-07-24T15:59:11","date_gmt":"2012-07-24T19:59:11","guid":{"rendered":"https:\/\/jeremystein.com\/brain\/?p=186"},"modified":"2012-07-24T15:59:11","modified_gmt":"2012-07-24T19:59:11","slug":"dont-use-infopaths-username-function-to-set-the-default-value-for-a-people-picker","status":"publish","type":"post","link":"https:\/\/jeremystein.com\/brain\/dont-use-infopaths-username-function-to-set-the-default-value-for-a-people-picker\/","title":{"rendered":"Don&#8217;t use InfoPath&#8217;s userName function to set the default value for a people picker"},"content":{"rendered":"<p>In InfoPath 2010, you can make a people picker default to the current user by setting AccountID&#8217;s default value to userName().  However, if you use this value later, say to compare to the form&#8217;s creator, you may run into an issue.  The userName function doesn&#8217;t include the domain.  Instead, you may want to fetch the user&#8217;s official AccountName from their profile in the FormEvents_Loading method.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In InfoPath 2010, you can make a people picker default to the current user by setting AccountID&#8217;s default value to userName(). However, if you use this value later, say to compare to the form&#8217;s creator, you may run into an issue. The userName function doesn&#8217;t include the domain. Instead, you may want to fetch the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[42],"tags":[],"class_list":["post-186","post","type-post","status-publish","format-standard","hentry","category-infopath"],"_links":{"self":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts\/186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/comments?post=186"}],"version-history":[{"count":0,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/posts\/186\/revisions"}],"wp:attachment":[{"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/media?parent=186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/categories?post=186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jeremystein.com\/brain\/wp-json\/wp\/v2\/tags?post=186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}