Return Value from web page to infopath form - InfoPath Dev
in

InfoPath Dev

Return Value from web page to infopath form

Last post 06-11-2008 09:27 AM by Anonymous. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-13-2008 08:44 AM

    Return Value from web page to infopath form

    Hey Guys,

     What I have done is created a lookup into active directory in my Infopath form that uses a person's username to query information(via web service). So, for example, if my username was User1 and another person(user2) were filling out the form. When it came to the username button they would enter user1 and hit refresh and all of the information pertaining to my username would be automatically filled out in the fields. This has been working excellently so except for one problem. There isn't really a database where we can look up a person's Username pertaining to their first name or last name, etc. So, I did some customization of the people search scope results and made it so that the information that is needed is returned and put all of it on a custom aspx page in sharepoint(using sharepoint designer so it is not linked to a master page or anything). Now, I have added a hyperlink inside of my form that opens up that particular web page so that the user filling out the form is able to search any other user. Now, my question is that is it possible to have a value, which would be a search result, returned, on the click of a button, and automatically filled in a certain field of an infopath form?

     


    So

    User 2 Searches John Smith

    John Smith search results come up as username: John.Smith

    after clicking a button, John.Smith is automatically filled into a field in my infopath form.

     

    I hope I am clear. Thanks for all of your help!
     

  • 06-11-2008 09:27 AM In reply to

    Re: Return Value from web page to infopath form

    Hey rpb1583

     

    You can obtain the functionality by using the webservice called: userprofileservice.asmx. Take a look at this guide:

     http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx?

    This guide does not have an example of how to get user information on another person. You can do this by:

    1. Adding a field
    2. Adding a button
    3. Actions for the button:
      1. Set field value: GetUserProfileByName:myfields:QueryFields:AccountName = The field you added in step 1
      2. Recieve data with GetUserProfileByName
      3. Now you have populated the GetUserProfileByName with all the data on the new user from the SharePoint user profile database.
      4. Perform step 1 to 11 followng the guide in the link above to fill out fields of your choice

    Tip of the day: The above mentioned method will leave you with a very rigid input field to get info on a new user. To solve this problem you can use the contact selector. Google: "InfoPath Contact Selector".

    Done :-)

    If this is making no sense at all let me know.

    Best regards

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