Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question

closed as off topic by Alex Angas Jun 2 '11 at 5:56

Questions on SharePoint Stack Exchange are expected to relate to SharePoint within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

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...

share|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.