Pre-populate User Info from Sharepoint Online - InfoPath Dev
in

InfoPath Dev

Pre-populate User Info from Sharepoint Online

Last post 04-11-2017 07:15 AM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-09-2017 11:44 PM

    Pre-populate User Info from Sharepoint Online

    Hi Guys,

    I'm having trouble finding an up to date method that works for the below scenario:

    Sharepoint Online (O365) Form Library with a Browser Enabled Infopath 2013 Form. The form is not public so the user must login to Office 365 to access it.

    First 3 Questions in the form are:

    First Name:
    Last Name:
    Email Address:

    I'd love to be able to pre-populate this with the current sharepoint users info so they don't have to fill this information out.

    I've managed to get Email Address to kind of work with a formula - substring-after(userName(), "i:0#.f|membership|")
    but how I can automatically add Firstname and Lastname info to the form is defeating me (I'm such a n00b with Infopath and SharePoint).

    I've read about SOAP, Rest and a few other methods but haven't seemed to get them to work with Sharepoint Online.

    Anyone know of a way that definitely works with Sharepoint Online?

  • 04-11-2017 07:15 AM In reply to

    Re: Pre-populate User Info from Sharepoint Online

     Hi! Last I checked, the UserProfile service (this is SOAP) was still available in Office365 forms. Here is a pretty good blog post: http://eimagine.com/using-infopath-and-the-web-service-getuserprofilebyname/

    You may have to play around a little to get the account name query parameter correct. The easiest (to me) way to do this is to add the query and data fields to the form canvas (just drag them onto the form someplace) and then add a button that executes the query. Add another button that sets the query field to the userName() function. If I recall correctly, the claims based user name is what works in O365 - so click the first button to set the account name to the userName() function, then the second to run the query to make sure you get results. Then you can test with other users besides yourself, just so you are comfortable with how the query works & what data is returned. :)

    Hilary Stoupa

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.