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?