I have a test box in my InfoPath form which is set to open in a browser. The value of the textbox is set to the username() formula.

When I create a new form, the username() formula evaluates to the logged in user's username, but the textbox is blank when an existing form is opened. This is fine, but should I expect the same behavior when the formula username() is used in a conditional statement?


That's actually a little bizarre. What Edition of SharePoint and InfoPath are you using? The username() function on a text field provides a default value on a new form, but then the value should be loaded from the saved XML when the form is opened. Could be one of two things:

1) Maybe the username() function wasn't added to the form when the existing forms you mentioned were saved? If so, the saved value will be blank.

2) Maybe the text box isn't getting saved to your form for some reason. If you could save the XML off to your site and open it up, you should see a value in the field. Curious if your value is getting saved...

| improve this answer | |
  • I was under the impression that, if I use the username function in a logic, then it will resolve on new and on existing forms. The function resolves if added via tools -> form options -> open and save -> rules. – i.jk Aug 30 '10 at 13:45
  • It's possible that it is never firing. If you didn't put it in the forms open option or in a save rule, then where did you put it? Can you provide some code here for us to look at? – Rob Wilson Aug 30 '10 at 20:07

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