none
Issue in getting Current User name in Infopath 2013 form RRS feed

  • Question

  • Hi All,

    I am using infopath form in Sharepoint 2013 list. I need to get current username when any user open the form for adding/editing/viewing items. I used userName() which is available in Infopath 2013 and it gives the user name only for Site Owners or users who have full control.

    If site members(with Contribute access) open the form, they get the below error.


    Hide error details

    You do not have permissions to access a SharePoint list that contains data required for this form to function correctly.

    An entry has been added to the Windows event log of the server. 

    Log ID:5566

     

    Any idea how to resolve this so that members can also get username in infopath form?

    P.S: I do not want to use UserprofileService.asmx in dataconnections.

    Thursday, November 7, 2019 8:23 AM

All replies

  • Hi,

    I cannot reproduce this issue in my SharePoint 2013 environment.

    I’m testing without UserprofileService.asmx in data connections. Even when I login as a user who has only View Only permission in this site, the InfoPath form can get its username without error.

    Do you have any other customization in this form other than insert the userName() formula?

    I suggest you switch to another list or another site and test again to see if the same issue will occur.

    Make sure you create the InfoPath form as a Site collection administrator. Also make sure the users with Contribute permission are listed in Central Administration > User Profile Service Application > Manage User Profiles.

    You can also check ULS logs for detailed and precise error message for this issue so that we can troubleshoot for you.

    Best regards,

    Chelsea Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, November 8, 2019 7:11 AM
  • Hi,

    I'm checking how it is going on with this issue.

    Please remember to update this thread if you have any progress.

    Thank you for your understanding.

    Best regards,

    Chelsea Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, November 11, 2019 9:47 AM
  • Hi Chelsea,

    Since i was directly working on PROD site. i don't have access to central admin and it takes some time to check with our admins. 

    And i received more requirements from users which cannot be achieved in Infopath.

    So I switched to SharePoint designer and created list forms and used jquery to get current user id.

    Thanks for your answer. Sorry i could not try this. i will check in dev server if possible.

    Regards,

    Sathya

    Thursday, November 14, 2019 9:02 AM
  • Hi,

    You can share your solution with SharePoint Designer in this thread if you would like to, as it will help others who meet similar question in this forum.

    Please let us know if you need further assistance.

    Thank you for your consideration.

    Best regards,

    Chelsea Wu


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Friday, November 15, 2019 8:10 AM