I need to show the user full name in InfoPath form. I tried the webservice and data connection for User Information list but still not getting. Can any one show me the steps he/she follow to show display name.
1 Answer
To get the current user's display name, assuming you have the User Information data connection already set up, I create a rule that runs when the form loads. The rule doesn't have any conditions, just to run when the form loads. The following actions are added to the rule:
- Set a field's value: select the field for User Information List-->queryFields-->Account
- Select infopath's function userName() as the value
- Then in the same rule I add the action to query the data connection for the User Information List.
In the field that I want to add the current user's display name to I add the default value of the User Information List-->dataFields-->Name.
At this point you don't have to use the Name field as I suggested, you can add any dataField value that you are wanting to retrieve information for the current user. Make sure that you checkmark "Refresh value when formula is recalculated" so that this value is updated each time the form is opened.
Don't be alarmed if the name that appears in the value is different from what you selected on the user information list. What is displayed on the value portion often changes to the field's properties name that is set on sharepoint. The end result is still the same though.