SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an infopath form loaded as an initiation/association form for a sharepoint workflow. I added a text field wich I want to be prefilled with the current user username. I'm using username() to get this. The problem is that it works great when I preview it in infopath, but once I deploy it to sharepoint the field is always empty.

I tried both setting username() as a default value for the field and with a rules on form load that sets the field value to username(). Neither works.

If I replace username() with any string (like "ciao"). the value is correctly set.

Any idea on how to get this working?

share|improve this question
What kind of authentication is your sharepoint farm using ? – Steve B Jun 21 '12 at 12:54
basic windows authentication – Maurizio Pozzobon Jun 21 '12 at 13:23
I had a similar issue, but i had issues with the function being case sensitive - userName() – Brent Jun 28 '12 at 3:54

I experienced the same problem and added additional idle call to username(); before assigning a value and it started to work (I used the call twice). If I deleted the idle call, the next username returned the null value. When I added it again, it worked fine. I didn't find a root of the problem, but now it works well with the idle call.

share|improve this answer
Was it in browser but not filler/client for, I wonder? Have you tried to enable always in Text box properties > Browser Forms (tab) > Postback Settings? – Gennady Vanin Геннадий Ванин Aug 24 '12 at 14:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.