locked
Current user name in infopath not changing RRS feed

  • Question

  • In my infopath(2007) form, I am displaying current user account using userprofile.asmx web service. So if a user opens the form, his name get displayed in a textbox by default. Now the problem is that when I submit the form from one library to another, the current user name is not getting changed and remains the same as of the person who has submitted the form. So if a new user opens the submitted form, instead of showing his name by default, the form is showing the name of submitter only.  

     

    To be precise current user box shows the correct information only if the form is new. once submitted and opened ,the problem comes and current user field displays the old name and not the current person name. I have checked the automatically retreive data when the form opens.

    Wednesday, February 1, 2012 3:37 AM

Answers

  • Hi Annupam,

     

    According to your description, I think the best way is reset the textbox. I suggest you to reset the text box after submit. You can add a rule on a submit button in InfoPath.then add an action ,in the action, you can reset the textbox value. Then when another user submit the form, it will get the user name is get by your userprofile.asmx web service.

     

    Thanks,

    Jack  

    Thursday, February 2, 2012 7:21 AM
    Moderator
  • I have got my problem solved. Before publishing , we need to add a rule to save,submit from infopath properties and set the text box to current user value. So everytime the user save the form or submit, the text box will be populated with current user name.
    Tuesday, February 7, 2012 6:14 AM

All replies

  • Hi Annupam,

     

    According to your description, I think the best way is reset the textbox. I suggest you to reset the text box after submit. You can add a rule on a submit button in InfoPath.then add an action ,in the action, you can reset the textbox value. Then when another user submit the form, it will get the user name is get by your userprofile.asmx web service.

     

    Thanks,

    Jack  

    Thursday, February 2, 2012 7:21 AM
    Moderator
  • i am also suffering with same issue, in my case, i have one drop down filed, i have to disable when the user creating the form and submit to the SharePoint document library, this form is going to open by the different users, i have to enable this dropdown when the particular user opens the form, for the rest of all others i have to disable, can any one please help me.

    i can check with the current user function in infopath, but it giving only the user id who created the form, i want user id who opened the form...

    any help..

     

    Thursday, February 2, 2012 3:18 PM
  • Try these steps:

    1) Remove or clear check box that syas "Automatically get data on form load" from your getuserprofile data connection.

    2) Then add rule on Form Load :  

         Add Action : "Query from Data Connection" =>  Select your getuserprofile data connection with no condition.

         Add Action :  Set "textBox" => with PreferredName from getuserprofile data connection.

     


    Dare to promise
    Thursday, February 2, 2012 7:50 PM
  • Hi,

         It seems like the form is taking the Created By value when the submitted form is opened. Try to check when the form is opened, the web service is called properly to get the current user.


    Ajeet
    • Proposed as answer by Nani B Thursday, February 2, 2012 8:16 PM
    Thursday, February 2, 2012 8:10 PM
  • I have got my problem solved. Before publishing , we need to add a rule to save,submit from infopath properties and set the text box to current user value. So everytime the user save the form or submit, the text box will be populated with current user name.
    Tuesday, February 7, 2012 6:14 AM