Problem with ADWS getmyinfo in published forms - InfoPath Dev
in

InfoPath Dev

Problem with ADWS getmyinfo in published forms

Last post 06-08-2017 12:35 PM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-08-2017 10:31 AM

    Problem with ADWS getmyinfo in published forms

    I am working on migrating to SharePoint 2013 and am having a problem using the getmyinfo from ADWS. If I preview the form it populates information from my user account, but if I publish the form and open it the form pulls in information for the SharePoint service account. How can I get it to pull the right user information when the form is published?
  • 06-08-2017 10:50 AM In reply to

    Re: Problem with ADWS getmyinfo in published forms

    Switch to using GetUserInfo and populate the query field with the user name (from the InfoPath user name function) on in a form load rule, then run the query. When you set up the data connection, don't set it to run on load. If you are using claims auth, you may need to use a substring-after function to clean up the data returned from the user name function - it is usually easiest to debug if you put the query & data fields on the form, along with a button to run the query, and a calculated value that shows the value returned by the user name function - once you figure out what you need to do, you can clean up the form.
    Hilary Stoupa

  • 06-08-2017 11:53 AM In reply to

    Re: Problem with ADWS getmyinfo in published forms

    Hillary, that worked to get it to return the information. The issue I have is this. I want to autofill a user name in a form. When I set the default on the field to be value{key-"cn"]  it won't return any information unless I check the box to "refresh value when form is recalculated". If I don't check the box nothing is returned. But with the box check any previously submitted form picks up the name of the user opening the form and not the user who created it. Is there a way to get around this? I saw something about the browser forms tab on the text box and making sure it is always doing round trip but that appears to make no difference.

  • 06-08-2017 12:35 PM In reply to

    Re: Problem with ADWS getmyinfo in published forms

    To autofill a user name, you should use rules to set the field. So in your form load rules, query for the data, then add a rule to set the value. Add a condition to your rules to only run if that field is blank - then you don't overwrite the user's name. I don't like using default values for this type of thing - not enough control. :)
    Hilary Stoupa

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